DevHow: Code Snippets from all around

Get the First day of the Week with an Exact Date

Tag(s): PHP

A function to get the first day of a particular week with an exact date.

function get_week_start($year, $month, $day)
{
	$timestamp = mktime(0, 0, 0, $month, $day, $year);
	return date('F j Y', $timestamp = mktime(0, 0, 0, $month, date('d', $timestamp)-date('w', $timestamp), $year));
}

Comments

You must be logged in to comment