Working with header refresh using PHP

Now a days most of the website are providing real-time data streaming, when user visit the website they want to display the content without reloading the page, but how ?

there is a simple way to do it, we are going to create simple html with iframe tag which will call the server page to get the content every 5 seconds.

<title> - Tutorial - Working with header refresh using PHP</title>
<iframe src="server-page.php"></iframe>

Now our server page which will refresh every 5 seconds using header function in php, its will display date and time.

echo "Every 5 seconds iframe will refresh : ".date("Y-m-d H:i:s");