尝试编写页面的一部分,当我们在广播 5a-10a MF 时显示流媒体播放器,并在我们不广播时显示其他内容。
这是我现在所拥有的,但它不起作用。我对 PHP 很陌生。谢谢!
<html>
<head>
<title>streaming</title>
</head>
<body>
<?php
//Get the current hour
$current_time = date(G);
//Get the current day
$current_day = date(l);
//Off air
if ($current_day == "Saturday" or $current_day == "Sunday" or ($current_time <= 5 && $current_time >= 10)) {
echo "We’re live Monday – Friday mornings. Check back then.";
}
// Display player
else {
echo "<a href="linktoplayer.html"><img src=http://www.psdgraphics.com/wp-content/uploads/2009/09/play.jpg></a>";
}
?>
</body>
</html>