Wednesday, 27 April 2016

Filters in PHP

By,
Nikhil

Filters in PHP: -The filter_var () function filters a variable with the specified filter.

Syntax:-filter_var(var, filtername, options);
Parameter
Description
var
“Required”, variable to be filter. 
Filter
“Required”, which filter has to be used?
options
Optional. Used for one or more flags.

These filters can be used as data validation in PHP. Mainly these filters are user for insecure sources.
After getting values from HTML form in different variables, before insert in to database we can use these filters for inserting validated data.

1} E-MAIL filter:-
This filter will validate email address in standard form.
 To Read More...Click Here