cfgcjm Posted February 24, 2008 Share Posted February 24, 2008 I have this script <?php echo file_get_contents('/tip.txt'); ?> but i now need to have it rotate files every day through 5 different files (ie:tip1.txt, tip2.txt...) is there a way to do this? Link to comment https://forums.phpfreaks.com/topic/92669-php-file-read-change-on-date/ Share on other sites More sharing options...
AndyB Posted February 24, 2008 Share Posted February 24, 2008 date("z") will tell you the day of the year - from 0 to 365 http://ca.php.net/manual/en/language.operators.arithmetic.php modulus operator will tell you the remainder of a division. That should get you started Link to comment https://forums.phpfreaks.com/topic/92669-php-file-read-change-on-date/#findComment-474884 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.