Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Predefined Filter Constants in PHP

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 106
    Comment on it

    There are many predefined Filter Constants in PHP which is passed as a second parameter value in the filter_var() function. Some of them are:

    • FILTER_VALIDATE_BOOLEAN: Used to validate a boolean.
    • FILTER_VALIDATE_EMAIL: It is used to validate an email address.
    • FILTER_VALIDATE_FLOAT: It is used to validate a float.
    • FILTER_VALIDATE_INT: It is used to validate an integer.
    • FILTER_VALIDATE_IP: It is used to validate an IP address.
    • FILTER_VALIDATE_URL:It is used to validate an URL address.
    • FILTER_SANITIZE_ENCODED: It removes/encodes special characters.
    • FILTER_SANITIZE_NUMBER_FLOAT: It removes characters such as:except digits, +- and etc.
    • FILTER_SANITIZE_SPECIAL_CHARS: It removes special characters
    • FILTER_SANITIZE_URL: It removes all illegal character from s URL
    • FILTER_SANITIZE_NUMBER_INT: It removes all characters except digits and + -
    • FILTER_CALLBACK: It is used to call a user defined function to filter the data.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: