Re: All Monday's & Thursdays



malcolm wrote:
Here's the script I used;
[...]
<?php
$day = date('D', $ts = strtotime('thursday', $ts));
echo "$day";


Note that $ts isn't initialized, so what you are really passing to date() as
the timestamp is 0, at least on my WinXP setup running PHP 5.1.2.

Perhaps earlier PHP versions translate your code into a negative timestamp,
or strtotime returns an error, which also results into a negative timestamp
(-1).

Try something as follows instead:

$day = date('D', $ts = strtotime('thursday'));

When this also returns an error, try capitalizing "thursday":

$day = date('D', $ts = strtotime('Thursday'));


JW


.