|
Posted by Janwillem Borleffs on 06/30/06 19:28
malcolm wrote:
> Here's antoher attempt;
>
> <?php
> $day = date('D', $ts = strtotime('thursday', $ts));
>
The line numbering is off, but I suspect that the problem is here again (not
initializing $ts before first use), which might cause strtotime to return -1
on your system.
> I find that the code 'Lost' posted in this thread works fine,
> I am only curious about this, thanks for your indulgence.
>
Lost's code is the straightforward way, simply increasing the days until the
end of the month is reached and picking out the Modays and Thursdays. The
code I suggested to the OP is more efficient, because it jumps right to the
Mondays and Thursdays, skipping in between days.
However, the use of strtotime appears to be less portable, and I do share
your curiousity regarding the error message it triggers.
JW
Navigation:
[Reply to this message]
|