Jump to content

Rotating Content on Schedule


jsarber

Recommended Posts

Ok. I've went digging through my archives of past website files and found the code I used:

 

<?php
             $dir = 'dbi/';
             $new_file = $dir.date('d-m-y').'.php';
             if(file_exists($new_file)) { /* if there's a file matching today's date, include it */
             include $new_file;
             }

             else { /* include a random file if there's no file for today */
             $files = glob($dir.'*.php');
             include $files[rand(0, count($files)-1)];
             }
             ?>

 

How can I change this to schedule according to both date and time? Is this possible?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...