artist19 Posted January 8, 2010 Share Posted January 8, 2010 I'm having a trouble with the code only with one letter "W" in the script far below. The line $day = date('W'); does not work at all but all other lines work. E.g. $day = date('j'); $day = date('w'); etc They work. But 'W' does not work. Why? I tried the array to add: 0 => "anydir/apage.php", Not working. 01 => "anydir/apage.php", Also not working. What is wrong? Thanks much in advance. <?php $content = array( 1 => "dir1/page1.php", 2 => "dir2/page2.php", 3 => "dir3/page3.php", [..... ] 365 => "dir/page365.php" ); $day = date('W'); $file = isset($content[$day]) ? $content[$day] : 'dir/fail.php'; include $file; ?> Quote Link to comment https://forums.phpfreaks.com/topic/187671-problem-with-w-but-fine-with-all-other-date-related-letters-why/ Share on other sites More sharing options...
PravinS Posted January 8, 2010 Share Posted January 8, 2010 What PHP version you are using? Quote Link to comment https://forums.phpfreaks.com/topic/187671-problem-with-w-but-fine-with-all-other-date-related-letters-why/#findComment-990785 Share on other sites More sharing options...
abazoskib Posted January 8, 2010 Share Posted January 8, 2010 Also, what do you mean it doesnt work..did you try to echo the contents of $day? Quote Link to comment https://forums.phpfreaks.com/topic/187671-problem-with-w-but-fine-with-all-other-date-related-letters-why/#findComment-990806 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.