3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function lastWeekDay ($mnt) { $result = strtotime("last day of $mnt"); $day = date('D', $result); if ('Sun' === $day) { $result -= 86400 * 2; } if ('Sat' === $day) { $result -= 86400; } return $result; } $date = '2009-10-22'; $sepparator = '-'; $parts = explode($sepparator, $date); $dayForDate = date("l", mktime(0, 0, 0, $parts[1], $parts[2], $parts[0])); echo $dayForDate;
Output for 4.3.0 - 7.1.0
Thursday