sorry but what do u think about this ?

<?php
for ($j=1;$j<13;$j++) {
   for ($i=1;$i<32;$i++) {
       $mk = mktime(0, 0, 0, $j, $i, 2004);
       $datex = date ("l", $mk);
       $daterest = date ("j/n/Y", $mk);
       if ($datex == "Tuesday") {
           echo $datex.">>>>>".$daterest."<br>";
       }
   }
}
?>

the problem that it outputs 6 weeks in March ... why ?



"Nabil" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Greetings;
>
> I need a help here ... I want to make function that return the dates of
> Tuesdays in a given year
>
> Example::
>
> Calc_Tuesdays (2004);
>
> //and it should return or echo
> 2004-01-06
> 2004-01-13
> 2004-01-20
> 2004-01-27
> 2004-02-03
> .
> .
> etc ....  ofcourse it should echo 5 Tuesdays in March by example
> so it should depends on the year not only current day+7
>
> any help please !!
> Nabil


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to