I want PHP to output some text, then sleep for a second and a half, and then output some more text.
Pentium10's answer did not quite work for me.. However when I went to the PHP documentation page, there were a lot of good comments on there.
http://php.net/manual/en/function.ob-flush.php
This worked for me using Firefox 3.5.9, PHP 5.2.11, Apache running off local Windows 7 laptop:
echo "test";
ob_end_flush();
flush();
usleep(x);
echo "test";
The ob_end_flush() was crucial to getting data sent.