<?phpwhile($text == '') { sleep(1); $text = file_get_contents('text.txt');}?>
<?php $file = 'text.txt'; while(filesize($file) == 0) { sleep(1); clearstatcache(); } echo 'File was changed!'; ?>