Jump to content

problem with 'W' but fine with all other date-related letters, why?


artist19

Recommended Posts

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;

 

?>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.