I have a script named data.php that looks like this:
/* do some stuff */
echo $result;
/* do some other stuff (eg database operations) */
I need to use the output of data.php in another script but I don't want the caller script to wait until data.php is finished.
What's the easiest way to do this?
Thanks in advance!
Take a look at the flush() function: http://php.net/manual/en/function.flush.php
Theoretically speaking (writing) one script should output to a stream, and the other should read from the same stream.
A good (and simple) example would be one file writes to a file on HD, the other reads from it. Simplest, but not the best.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With