<?php $date = 16; $day = "Wednesday"; $x=0; $start = date("Y-m-") . $date; While(date("l", strtotime($start ."-" .$x . "months")) != $day){ $x++; } Echo $x . " months ago.";
You have javascript disabled. You will not be able to edit any code.