Just looking for a code snippet to get me started. I’ve found a few examples but none of them are in depth enough for what I need.
I need to have an hourly content rotation.
6:00a to 9:00a CST load page1.html
9:00a to 11:00a CST load page2.html
You can just have those to HTML files created alread and put them in the same directory as the “main” file visitors load (the PHP file).
Then the php will check the current time and then depending on that it will include the right HTML.
// Get the current hour of the day in 24 hour format (no leading zeros)
$hour = date("G");
if($hour >= 6 && $hour < 9) include("page1.html);
else if($hour >=9 && $hour < 11) include("page2.html");
I’m not much of a php programmer but I like to tinker once in a while.