Im a sort of beginer and Im asking this question :
Suppose I hage a php file look like this:
`<?php
echo “Your job is acceptedn”;
<code>$f=fopen(some_big_file);
// Do intensive work that takes 5 seconds
fclose(some_big_file);
</code>
<code>$f=fopen(some_big_file);
// Do intensive work that takes 5 seconds
fclose(some_big_file);
</code>
$f=fopen(some_big_file);
// Do intensive work that takes 5 seconds
fclose(some_big_file);
?>
`
The only thing I want the user to see is the first message but in this case it takes 5 seconds before seeing the message.
Is there something I can add (like ‘return’) to have the php script continue the heavy job in backgroud (I mean after the echoed message) so the time to get the echo would not depend of the heavy work?
Hope I’m clear but not sure;-)
Thanks
I tried to remove the heavy work and the message is echoed instantly
1