Hello - can't figure this out.

How can i create the code that will give me the date of the last friday?

i thought something like this would work(it was yesterday!) but i guess its the wrong vribale/eqation

$tday=date('N');

if($tday !=5){
	$tdiff = $tday-5;
	$sdate = $tdiff-22;

 	$dayr=date('D, d M',strtotime($sdate.' days'));

	//echo"NOT FRI, $tdiff $sdate ($dayr)<BR><BR>";
}

many thanks in advance. D.

    if (date("w") == 0) {
    $adjuster = 6;
    }
    else {
    $adjuster = date("w") +2;
    }
    $wk1 = date("d/m/y", strtotime("-" .$adjuster. " days -3 weeks"));

    fridays' date 3 weeks ago...

      haha - no way. Will try that in the morning!

        Write a Reply...