- date: documentation ( source)
- strtotime: documentation ( source)
<?php
$LastFridayOfMonth = date('Y-m-d', strtotime("last Friday", strtotime("2013-06-01")));
echo "$LastFridayOfMonth \r" ;
$LastFridayOfMonth = date('Y-m-d', strtotime("last Friday", strtotime("June 2013")));
echo "$LastFridayOfMonth \r";
$LastFridayOfMonth = date('Y-m-d', strtotime("last Friday", strtotime("2013-06-31")));
echo "$LastFridayOfMonth \r";
echo "Correct answer : 2013-06-28 !"
?>