PHP Filter function

Source: Internet
Author: User
Tags encode string

PHP filters are used to validate and filter data from non-secure sources, such as user input.

The filter function is part of the PHP core. These functions can be used without installation.

Filter_callback invokes a user-defined function to filter the data. Filter_sanitize_string Remove tags, remove or encode special characters. filter_sanitize_stripped"String"the alias of the filter. filter_sanitize_encoded URL-encode string that removes or encodes special characters. Filter_sanitize_special_chars HTML Escape Character‘"<>& characters with ASCII values less than 32. Filter_sanitize_email Delete all characters except letters, numbers, and!#$%&' *+-/=?^_ ' {|} [Email protected][]filter_sanitize_url removes all characters except letters, numbers, and-_.+!* '(), {}|\\^~[] ' <>#% ";/?:@&=filter_sanitize_number_int delete all characters except numbers and +-filter_sanitize_number_float Remove all characters except numbers, +-and., EE. Filter_sanitize_magic_quotes application Addslashes (). Filter_unsafe_raw does not filter, remove or encode special characters. Filter_validate_int validates the value with an integer in the specified range. Filter_validate_boolean returns True if it is "1", "true", "on" and "Yes", and returns False if it is "0", "false", "off", "No", and "". Otherwise, NULL is returned. Filter_validate_float validates the value with a floating-point number. FILTER_VALIDATE_REGEXP validates values based on REGEXP, a Perl-compatible regular expression. Filter_validate_url validates the value as a URL. Filter_validate_email the value as an e-mail to verify. Filter_validate_ip the value as an IP address to verify. 

PHP Filter function

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.