高血压专题网,内容丰富有趣,生活中的好帮手!
高血压专题网 > php 获取指定日期所在月份的最后一天

php 获取指定日期所在月份的最后一天

时间:2018-09-17 14:43:30

相关推荐

php 获取指定日期所在月份的最后一天

php 获取指定月最后一天:

<?php

function getthemonth($date)

{

$firstday = date('Y-m-01', strtotime($date));

$lastday = date('Y-m-d', strtotime("$firstday +1 month -1 day"));

return $lastday;

}

echo getthemonth('-5-16');

?>

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。