checkdate() 函数验证公历日期。如果日期有效,则返回 TRUE,否则返回 FALSE。
checkdate(month, day, year)
月份 - 将月份指定为 1 到 12 之间的数字
day - 将日期指定为 1 到 31 之间的数字
year - 指定年份作为 1 到 32767 之间的数字
立即学习“PHP免费学习笔记(深入)”;
如果日期有效,则 checkdate() 函数返回 TRUE,否则返回 FALSE。
以下是示例 -
现场演示
<?php var_dump(checkdate(10,29,2018)); ?>
bool(true)
让我们看另一个示例 -
现场演示
<?php $month = 9; $day = 30; $year = 2018; var_dump(checkdate($month, $day, $year)); ?>
bool(true)
以上就是在PHP中,translate the following:checkdate()函数的详细内容,更多请关注php中文网其它相关文章!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号