News Feed
Sections




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

DevShed:
Validating URL Protocols, Hosts and Paths with Filters in PHP 5
August 20, 2009 @ 10:45:59

DevShed continues their validation series today with this new tutorial, a look at validating URLs, host and paths with the filter extension bundled with PHP.

Validation process performed on URLs [in the previous part of the series] was pretty simplistic. Thus, in this sixth episode of the series I'm going to dig deeper into the usage of the FILTER_VALIDATE_URL filter to show you how to validate different portions of a URL, including its protocol, host and eventual paths.

They enforce the filtering by adding in the FILTER_FLAG_SCHEME_REQUIRED or FILTER_FLAG_HOST_REQUIRED flags to the filters to ensure the information is valid too (not just in the right format).

0 comments voice your opinion now!
tutorial filter url host path validate


blog comments powered by Disqus

Similar Posts

IBM developerWorks: PHP frameworks, Part 1: Getting started with three popular frameworks

Matthew Weier O'Phinney's Blog: Taming SplPriorityQueue

Stuart Herbert's Blog: PHP Components: Shipping Web Pages With Your Components

Zend Developer Zone: Uploading YouTube Videos with Zend Framework

Christian Schaefer's Blog: Using Zend Framework components in a Symfony2 project


Community Events





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


interview language threedevsandamaybe introduction install series laravel list podcast unittest framework refactor release developer opinion symfony2 community testing code experience

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