wordpress 日付から曜日を返す関数

function day_of_week($date) {
	$get_date = get_field($date);
	$datetime = date_create($get_date);
	$week = array("日", "月", "火", "水", "木", "金", "土");
	$w = (int)date_format($datetime, 'w');
	$youbi = $week[$w];
	return $youbi;
}

使用例)

echo day_of_week("2013-01-01";
PAGE TOP