php获得月和年的开始和结束日期

2022-05-07

以下示例是关于Php中包含php获得月和年的开始和结束日期用法的示例代码,想了解php获得月和年的开始和结束日期的具体用法?php获得月和年的开始和结束日期怎么用?php获得月和年的开始和结束日期使用的例子?那么可以参考以下相关源代码片段来学习它的具体使用方法。

[英]:php get start and end date of month and year源码类型:Php
<?php

$query_date = '2010-02-04';

// First day of the month.
echo date('Y-m-01', strtotime($query_date));

// Last day of the month.
echo date('Y-m-t', strtotime($query_date));

本文地址:https://www.itbaoku.cn/snippets/785226.html