If I\'ve got a $date YYYY-mm-dd and want to get a specific $day (specified by 0 (sunday) to 6 (saturday)) of the week that YYYY-
$date
YYYY-mm-dd
$day
YYYY-
You can use the date() function:
date('w'); // day of week
or
date('l'); // dayname
Example function to get the day nr.:
function getWeekday($date) { return date('w', strtotime($date)); } echo getWeekday('2012-10-11'); // returns 4