Add IE mode to PHP scripts

This commit is contained in:
DL6ER
2017-01-14 15:29:23 +01:00
parent b7b7217fb0
commit a6b3bc1cb4
2 changed files with 8 additions and 5 deletions

View File

@@ -6,7 +6,10 @@ header('Content-Type: text/event-stream');
header('Cache-Control: no-cache');
function echoEvent($datatext) {
echo "data: ".implode("\ndata: ", explode("\n", $datatext))."\n\n";
if(!isset($_GET["IE"]))
echo "data: ".implode("\ndata: ", explode("\n", $datatext))."\n\n";
else
echo $datatext;
}
// Credit: http://stackoverflow.com/a/4694816/2087442