JS requests to PHP through AJAX. Does PHP reply that echo represents the end of a request? Can there be multiple echo?

JS requests to PHP through AJAX. Does PHP response echo represent the end of a request? Can there be multiple echo?

can PHP respond to this AJAX request multiple times?

for example,

PHP:

for($i = 0 ; $i < 200000 ; $i PP){
    mission_1()
}

echo ("mission 1 done");

for($i = 0 ; $i < 200000 ; $i PP){
    mission_2()
}

echo ("mission 2 done");

this requirement arises because you want to use PHP to populate the MySQL database.
such as an empty database, use PHP scripts to write large amounts of data to the database for testing.

Test database response, test database query speed, and so on.

Mar.18,2021
For

testing the database, I suggest you test it in one way instead of through an ajax request. You can get a microtime as the start time, and then, where you need to check the execution time, get the start time before microtime, minus, which is the program execution time. In this way, you can print the execution time of multiple segments of the program


and execute the PHP script directly from the command line.
use the time function to determine the time interval


script ends, the request ends
when the script ends, exit , return .


I don't know when the php program will end. This may be a little annoying.

Menu