Horje

Example of Server-Side Code Example Code in PHP

Code in PHP

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

$time = date('r');
echo "data: The server time is: {$time}\n\n";
flush();
?>





Type:
php
Category:
Web Tutorial
Sub Category:
HTML SSE API
Uploaded by:
Admin