gpt4 book ai didi

php - 在 PHP 中获取给定月份的第一天?

转载 作者:可可西里 更新时间:2023-11-01 00:09:06 24 4
gpt4 key购买 nike

<分区>

我一直在尝试让下面的代码正常工作,虽然它适用于 6 月,但不适用于 7 月。

$first_day_of_month 的值为 3,而周二应为 2。

$date = strtotime('20140702'); // July 02, 2014
$month = date('m',$date);
$year = date('Y',$date);
$days_in_month = date('t',$date);
$first_day_of_month = date('w', strtotime($year . $month . 01)); // sunday = 0, saturday = 6

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com