flush() already
A function that has been on my ignore-list for quite some time, but not anymore. PHP's function flush() makes sure the output you have generated gets sent to the browser. Now, why is this useful? To make it obvious your script is still running to the end-user for example.
Imagine you have one of those lame "value my site" scripts, that connects to the Google PageRank server, Alexa, Yahoo Backlinks and what not. 99% of all scripts simply connect to the servers in one turn, making the script look frozen for atleast a couple of seconds. Statistics show all users leave if your script is running more than 9.81 seconds (OK, I made that up).
To fix the frozen state, add a flush() line between every connection, example:
<?php
connectToGoogle();
flush();
connectToAlexa();
?>
The moment the script is finished with connectToGoogle(), it will show the output it has already and continue to Alexa. Not clear enough? Here is my little example:
