News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Devollo.com:
Data Filtering Using PHP's Filter Functions - Part one
September 15, 2008 @ 09:33:33

On Devollo.com the first part of a series looking at something every PHP developer (or any other for that matter) should include in their application - data filtering.

Filtering data. We all have to do it. Most, if not all of us, despise doing it. However, unbeknown to most are PHP's filter_* functions, that allow us to do all sorts of filtering and validation. Using PHP's filter_* functions, we can validate and sanitize data types, URLs, e-mail addresses, IP addresses, strip bad characters, and more, all with relative ease. This is part one of two, covering filter_var() and the different constants and flags that can be set.

This method, using the filter extension, takes a lot of the work out of making sure that user-submitted data is what it should be. They include examples of how to filter numeric types, URLs, email addresses and how to sanitize the data to be sure there's no cross-site scripting or SQL injections to be found. This is a great reference if you're looking to get started with the filter extension.

0 comments voice your opinion now!
data filter extension pear tutorial example


blog comments powered by Disqus

Similar Posts

Rob Allen: Setting up PHP & MySQL on OS X Mavericks

Rob Allen's Blog: Using Zend\Loader\Autoloader

Rasmus Lerdorf's Blog: ZeroMQ + libevent in PHP

Learn.IIS.net: Build a High-Performance PHP Stack with Windows IIS and Zend Server

Richard Thomas' Blog: Solar Framework Shorts - Basic Sql Profiling


Community Events





Don't see your event here?
Let us know!


package laravel library security framework symfony interview language introduction composer opinion release version podcast voicesoftheelephpant update community series install tool

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework