PHP 怎么获得“几月的第几个周几”这样的日期?

比如父亲节是“6月的第3个周日”,母亲节是“5月的第2个周日”。

0
0

1 个回答

可以借助 strtotime() 实现

date('Y-m-d', strtotime('Third Sunday Of June 2023'))
// 结果:2023-06-18
date('Y-m-d', strtotime('Second Sunday Of May 2023'))
// 结果:2023-05-14
1
0
登录注册后添加答案