PHP Validation classes (verification of Email, numbers, strings, etc.)

Source: Internet
Author: User
This article shares a PHP validation class code that can be used to verify the email address, verify the number, verify the date, and so on. A friend in need may wish to make a reference.

The code for the PHP validation class is as follows:

     0 && ($D <= $MON [$M] | |      $D ==29 && $Y%4==0 && ($Y%100!=0 | | $Y%400==0)); }//end of Is_data function}?>

Example of an invocation of the 2,php validation class:

 
      Is_email ($_post[' email '))     echo "Email is valid!", Else     echo "not a Valid email"; Echo "
"; if ($val->is_number ($_post[' number ')) echo "number is valid!", Else echo "Not a Valid number"; echo "
"; if ($val->is_alpha_numeric ($_post[' string ')) echo "string is valid!", Else echo "Not a Valid String"; echo "
"; if ($val->is_date ($_post[' date ') >0) echo "date is valid!", Else echo "not a Valid date"; echo "
  • 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.