Copy code The code is as follows:
/**
* Get the start date and end date of the month where the specified date is located
* @param string $date
* @param boolean returns the start date if true, otherwise returns the end date
* @return array
* @access private
*/
private function getMonthRange( $date, $returnFirstDay = true ) {
$timestamp = strtotime( $date );
if ( $returnFirstDay ) {
$monthFirstDay = date( 'Y-m-1 00:00:00', $timestamp );
return $monthFirstDay;
} else {
$mdays = date( 't', $timestamp ); $timestamp );
return $monthLastDay;
}
}
http://www.bkjia.com/PHPjc/328099.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/328099.htmlTechArticleCopy code The code is as follows: /** * Get the start date and end date of the month on the specified date* @param string $date * @param boolean returns the start date if true, otherwise returns the end date...