In PHP, translate the following: checkdate() function

WBOY
Release: 2023-09-18 06:00:01
forward
690 people have browsed it

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

checkdate() function verifies the Gregorian calendar date. Returns TRUE if the date is valid, FALSE otherwise.

Syntax

checkdate(month, day, year)
Copy after login

Parameters

  • Month - Specify the month as a number between 1 and 12

  • < li>

    day - Specify the date as a number between 1 and 31

  • year - Specify the year as A number between 1 and 32767

Returns

The checkdate() function returns TRUE if the date is valid, otherwise it returns FALSE.

Example

Here are the examples-

Live Demonstration

<?php
   var_dump(checkdate(10,29,2018));
?>
Copy after login

Output

bool(true)
Copy after login
Copy after login

Example

Let’s see Another example -

Live demo

<?php
   $month = 9;
   $day = 30; $year = 2018;
   var_dump(checkdate($month, $day, $year));
?>
Copy after login

Output

bool(true)
Copy after login
Copy after login

The above is the detailed content of In PHP, translate the following: checkdate() function. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!