This is probably a job for Javascript, not PHP (not that I know how you'd do it in Javascript). PHP code is only executed on the web server, so the only way to change the page contents using PHP is to make another trip to the server, e.g. refresh the page. I suppose you could just refresh the page automatically every second, using something like
Code:
header("Refresh: 1");
I don't know if that would be too popular with your users, though.