Now, in normal terms, the first friday in April 2004 is the 02nd April, however strtotime takes that as the 2004th day of April this year, and gives a date in September 2009.....
Apart from doing
<?php
$startdate=strtotime("1 April 2004");
$date=date("D",$startdate);
if ($date=="Sat"){$startdate +=(86400*6);}
if ($date=="Sun"){$startdate +=(86400*5);}
if ($date=="Mon"){$startdate +=(86400*4);}
if ($date=="Tue"){$startdate +=(86400*3);}
if ($date=="Wed"){$startdate +=(86400*2);}
if ($date=="Thu"){$startdate +=86400;}
echo date("D d M Y",$startdate);
?>
then adding 86400 for each day until $day = "Fri" is there a shorter way ?
I was expecting strtotime to be able to handle that.... does anyone know of a way ?
(Looking for some short clean code - the less lines the better... so any help would be appreciated..)