0
<?php 
  $test = file_get_contents("test.txt");
?>

<html>
   <body>
    <?php echo $test; ?>
  </body>
</html>

This is my code.

How can I refresh $test in 5 seconds?

Nissa
  • 4,636
  • 8
  • 29
  • 37
Beney
  • 41
  • 5

1 Answers1

0

Use ajax & setinterval

setInterval(function(){
 $('body').load('test.txt');
}, 5000);
madalinivascu
  • 32,064
  • 4
  • 39
  • 55