Phpfilter_var filters specified data. Define and use the filter of the filter_var () function and the filter specified by a variable. A success or a failure of FALSE is returned. Syntax filter_var (variable, filter, opti definition and usage
The filter of the filter_var () function and the filter specified by a variable.
A success or a failure of FALSE is returned.
Syntax
filter_var(variable, filter, options)
Variable: required. Filter: Optional. Specify the number of filters to use. The default value is FILTER_SANITIZE_STRING.
Check whether PHP filters are completely possible. refer to the filters. the filter number can be a number name (such as FILTER_VALIDATE_EMAIL) or an ID number (such as 274) options: Optional. Specify the flag/option of an associated array or a single flag/option. Check various possible options and flags for each filter
Let's take a look at the filter_var instance tutorial.
If (! Filter_var ("someone @ example....com", FILTER_VALIDATE_EMAIL) {echo ("E-mail is not valid ");} else {echo ("E-mail is valid") ;}?>
Output result.
E-mail is not valid
Filters the filter_var () function and the filter specified by a variable. A success or a failure of FALSE is returned. Syntax filter_var (variable, filter, opti...