ballhogjoni Posted January 5, 2009 Share Posted January 5, 2009 if your compiler is running thru a php script and it reaches an echo does it print the echo out right then or does it wait till then end of the script to print it out? EX: <?php //some php code echo 'this stuff'; //does the compiler echo this right now or does it finish running through the entire script? //some more php code ?> Quote Link to comment https://forums.phpfreaks.com/topic/139547-echo-question/ Share on other sites More sharing options...
Maq Posted January 5, 2009 Share Posted January 5, 2009 PHP is interpreted not compiled unless you're using something like Zend but ultimately it is still interpreted. Compilers do not run through scripts, this doesn't really make any sense to me. What exactly is this script? Quote Link to comment https://forums.phpfreaks.com/topic/139547-echo-question/#findComment-729973 Share on other sites More sharing options...
ballhogjoni Posted January 5, 2009 Author Share Posted January 5, 2009 nothing just trying to understand when php sends the echo to the browser. Quote Link to comment https://forums.phpfreaks.com/topic/139547-echo-question/#findComment-729975 Share on other sites More sharing options...
aximbigfan Posted January 5, 2009 Share Posted January 5, 2009 If in CMD line, PHP will output each echo. If in a webserver, the content will not be sent to the browser until the script is done. Chris Quote Link to comment https://forums.phpfreaks.com/topic/139547-echo-question/#findComment-729980 Share on other sites More sharing options...
ballhogjoni Posted January 5, 2009 Author Share Posted January 5, 2009 ty Quote Link to comment https://forums.phpfreaks.com/topic/139547-echo-question/#findComment-729982 Share on other sites More sharing options...
slushpuppie Posted January 5, 2009 Share Posted January 5, 2009 php will always do it's processing on the server and send the html over in one chunks... if you've ever tried to do: header('location: somewhere.php') after echoing or outputting any html or blank spaces you'll see this in action... Quote Link to comment https://forums.phpfreaks.com/topic/139547-echo-question/#findComment-729988 Share on other sites More sharing options...
PFMaBiSmAd Posted January 5, 2009 Share Posted January 5, 2009 I'm guessing that your question is related to this thread - http://www.phpfreaks.com/forums/index.php/topic,232730.0.html php, web servers, and browsers all do various buffering/compression that prevent incremental content from being sent to the browser. Web servers are designed to receive requests for (whole) web pages and output those whole pages. If you want to do anything on a smaller scale, you must generate a separate request for each piece of information (i.e. AJAX.) Quote Link to comment https://forums.phpfreaks.com/topic/139547-echo-question/#findComment-730227 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.