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,598
  • 8
  • 29
  • 37
Beney
  • 41
  • 5

1 Answers1

0

Use ajax & setinterval

setInterval(function(){
 $('body').load('test.txt');
}, 5000);
madalinivascu
  • 31,556
  • 4
  • 35
  • 52