Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
ini_set('max_execution_time', '300');
$G = date ("G") - 1;
$date = date("Ymd".$G."is");
$channel = 1968;
$strings = 7;
$tv=simplexml_load_file("http://www.teleguide.info/download/new3/xmltv.xml");
$i = 0;
foreach ($tv as $v) {
if ($v->attributes()->channel == $channel) {
if ($i == 0) {
if ($date >= $v->attributes()->start && $date <= $v->attributes()->stop) {
echo "<h2>".date("H:i", strtotime($v["start"]))." ".$v->title."</h2>\n";
$i++;
}
} else if ($i <= $strings) {
echo "<h2>".date("H:i", strtotime($v["start"]))." ".$v->title."</h2>\n";
$i++;
} else break;
}
}
?>