📜  php 从日期获取日期 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:14.953000             🧑  作者: Mango

代码示例6
// how to check the day of any date in php?

//Our YYYY-MM-DD date string.
$date = $request->start_date;

//Convert the date string into a unix timestamp.
$unixTimestamp = strtotime($date);

//Get the day of the week using PHP's date function.
$dayOfWeek = date("l", $unixTimestamp);

//Print out the day that our date fell on.
$day = $date . ' fell on a ' . $dayOfWeek;