<script> function writer() { document.write( '<?php reader(); ?>') } //выводим всё каждую секунду setInterval('writer()', 1000) </script>