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;

 

?>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.