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