<?php
header('Content-Type: text/event-stream');
header('Cache-Control: no-cache'); 

$timestamp = time();
$message = 'The current server time is ' . date("g:i:s", $timestamp);

echo "id: $timestamp \n"; // use the timestamp for the id
echo "data: $message \n\n";
flush();
?>