WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

PHP 5 Filter Functions


PHP Filter Introduction

This PHP channels is utilized to approve and channel information originating from unreliable sources, like client input.


Installation

As of PHP 5.2.0, the channel capacities are empowered of course. There is no establishment expected to utilize these functions.


Runtime Configurations

The conduct of these capacities is influenced by settings in php.ini:

Name Description Default Changeable
filter.default Filter all $_GET, $_POST, $_COOKIE, $_REQUEST and $_SERVER information by this channel. Acknowledges the name of the channel you like to use as a matter of course. See the channel list for the rundown of the channel names "unsafe_raw" PHP_INI_PERDIR
filter.default_flags Default banners to apply when the default channel is set. This is set to FILTER_FLAG_NO_ENCODE_QUOTES as a matter of course for in reverse similarity reasons NULL PHP_INI_PERDIR

PHP 5 Filter Functions

Function Description
filter_has_var() Checks if a variable of a predetermined information type exist
filter_id() Returns the channel ID of a predefined channel name
filter_input() Gets an outside factor (for example from structure input) and alternatively channels it
filter_input_array() Gets outer factors (for example from structure input) and alternatively channels them
filter_list() Returns a rundown of all bolstered filters
filter_var_array() Gets different factors and channel them
filter_var() Filters a variable with a predetermined filter

PHP 5 Predefined Filter Constants

Constant ID Description
FILTER_VALIDATE_BOOLEAN 258 Validates a boolean
FILTER_VALIDATE_EMAIL 274 Validates an email address
FILTER_VALIDATE_FLOAT 259 Validates a float
FILTER_VALIDATE_INT 257 Validates an integer
FILTER_VALIDATE_IP 275 Validates an IP address
FILTER_VALIDATE_REGEXP 272 Validates a normal expression
FILTER_VALIDATE_URL 273  Validates a URL
FILTER_SANITIZE_EMAIL 517 Removes every illicit character from an email address
FILTER_SANITIZE_ENCODED 514 Removes/Encodes unique characters
FILTER_SANITIZE_MAGIC_QUOTES 521 Apply addslashes()
FILTER_SANITIZE_NUMBER_FLOAT 520 Remove all characters, with the exception of digits, +-and alternatively .,eE
FILTER_SANITIZE_NUMBER_INT 519 Removes all characters with the exception of digits and + -
FILTER_SANITIZE_SPECIAL_CHARS 515 Removes unique characters
FILTER_SANITIZE_FULL_SPECIAL_CHARS    
FILTER_SANITIZE_STRING 513 Removes labels/unique characters from a string
FILTER_SANITIZE_STRIPPED 513 Alias of FILTER_SANITIZE_STRING