Page 1 of 1

Showing output while parsing

Posted: Sat Nov 08, 2003 2:16 pm
by Cruzado_Mainfrm
is it possible that u can send output to the browser while the php engine is parsing the code? like:

Code: Select all

<?php
echo "Initializing";
//do a lot of stuff, like loops and everything, which takes long time
echo "Done";
?>


Initializing has to be shown first, then we the process finishes "Done" is sent to the browser, meaning the script has ended at that time.

what are the functions to do this? is it output something? can this be done? if so, a little example or tutorial on how to do this will be appreciated

is it flush() or something like that??

Posted: Sat Nov 08, 2003 3:02 pm
by volka
it takes a long time to parse the code?
If you refer to "execute the code" then ,yes, flush() is probably what you're looking for.

Posted: Sat Nov 08, 2003 8:15 pm
by Cruzado_Mainfrm
yeah i'm making a spider that crawls lyric websites, and this takes loooong... so i want to output very echo saying: "Now displaying songs for artist $artist" and things of that nature :D thnx volka :D

Posted: Mon Nov 10, 2003 5:04 am
by JAM
Must note the similiar usage of ob_flush if you are using output buffering.