artist19 Posted January 7, 2010 Share Posted January 7, 2010 I have these scripts for various purposes from "--" of the Day, "--" of the Week, etc. All of them have been working fine for the past months. Then after the new year, now all of these scripts on all pages don't work at all. It's like Y2K. Why, none of them work? What went wrong? They all worked fine until after the new year now. Please help, thanks. <?php $content = array( 1 => "dir/page1.php", 2 => "dir/page2.php", 3 => "dir/page3.php", [..... ] 365 => "dir/page365.php" ); $day = date('z'); $file = isset($content[$day]) ? $content[$day] : 'dir/fail.php'; include $file; ?> Link to comment https://forums.phpfreaks.com/topic/187541-new-year-date-stops-working-in-php/ Share on other sites More sharing options...
Mchl Posted January 7, 2010 Share Posted January 7, 2010 Nothing wrong with this code. Should be working fine. Remember that date('z') will be 0 for Jan 1st. Link to comment https://forums.phpfreaks.com/topic/187541-new-year-date-stops-working-in-php/#findComment-990189 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.