PHP Validation Time validity _php Tutorial

Source: Internet
Author: User
The validity of the PHP validation date has a built-in function, the Checkdate function, which shares the definition and usage of the checkdate function.

Checkdate Definition and usage

The Checkdate () function validates a trellis-high-date. If the specified value is valid, the function returns True, otherwise false is returned.

The date is valid in the following cases:

Month is between and includes 1-12

The value of day is within the range of days that a given month should have, and leap years are taken into account.

Year is between and includes 1 to 32767

Checkdate syntax

Checkdate (Month,day,year)

Month is required. Prescribed month.

Day required. Prescribed day.

Year required. Prescribed year.

Examples of use are as follows:

 

The result will be output:

BOOL (TRUE)
BOOL (FALSE)
BOOL (TRUE)

Articles you may be interested in

    • How JavaScript validates date-time validity
    • PHP verifies the correctness and validity of the mailbox
    • PHP Get time interval method Summary, PHP display forum posting time interval method Daquan
    • PHP get the current time, time stamp method Big Summary
    • thinkphp Automatic validation and auto-fill Invalid workaround
    • PHP Extract the birthday date from the ID number and the function to verify whether it is a minor
    • PHP get today's tomorrow yesterday time stamp of N method summary
    • PHP gets the start timestamp and end timestamp for today, yesterday, last week, this month

http://www.bkjia.com/PHPjc/779408.html www.bkjia.com true http://www.bkjia.com/PHPjc/779408.html techarticle the validity of the PHP validation date has a built-in function, the Checkdate function, which shares the definition and usage of the checkdate function. Checkdate define and use the Checkdate () function to validate a lattice ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.