2023-09-17

在PHP中,translate the following:checkdate()函数

在PHP中,translate the following:checkdate()函数

checkdate() 函数验证公历日期。如果日期有效,则返回 TRUE,否则返回 FALSE。

语法

checkdate(month, day, year)
登录后复制

参数

  • 月份 – 将月份指定为 1 到 12 之间的数字

  • day – 将日期指定为 1 到 31 之间的数字

  • year – 指定年份作为 1 到 32767 之间的数字

返回

如果日期有效,则 checkdate() 函数返回 TRUE,否则返回 FALSE。

示例

以下是示例 –

 现场演示

登录后复制

输出

bool(true)
登录后复制
登录后复制

示例

让我们看另一个示例 –

 现场演示

登录后复制

输出

bool(true)
登录后复制
登录后复制

以上就是在PHP中,translate the following:checkdate()函数的详细内容,更多请关注php中文网其它相关文章!

https://www.php.cn/faq/609785.html

发表回复

Your email address will not be published. Required fields are marked *