PHP Filter

Programming for Search Engines 101. An area for avid PHP and .NET developers to chat about Programming techniques and how to make better use of search engines.

Moderator: Moderators

PHP Filter

Postby jay » Wed May 20, 2009 11:00 pm

A PHP filter is used to validate and filter data coming from insecure sources. For example to validate whether the input is email address or integer, it's easy to validate using inbuilt PHP functions like filter_var($email, FILTER_VALIDATE_EMAIL) to server side validate email address and filter_var($int, FILTER_VALIDATE_INT) to validate whether the input is integer.

To test, validate and filter user input or custom data is an important part of any web application.

The PHP filter extension is designed to make data filtering easier and quicker.

Almost all web applications depend on external input. Usually this comes from a user or another application (like a web service). By using filters you can be sure your application gets the correct input type.

filter_var() - Filters a single variable with a specified filter
filter_var_array() - Filter several variables with the same or different filters
filter_input - Get one input variable and filter it
filter_input_array - Get several input variables and filter them with the same or different filters

For more details -
Jay M
Write Less, Do More
jay
 
Posts: 475
Joined: Wed Nov 22, 2006 12:05 am
Location: Cochin, India.

Return to Programming

Who is online

Users browsing this forum: No registered users and 3 guests

cron