PHP
  Home arrow PHP arrow Working with Regular Expressions with Filters in PHP 5
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
PHP

Working with Regular Expressions with Filters in PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 1
    2009-08-12


    Table of Contents:
  • Working with Regular Expressions with Filters in PHP 5
  • Review: validating floating numbers with the filter extension
  • Checking regular expressions with the filter extension
  • Validating URLs at a basic level

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Working with Regular Expressions with Filters in PHP 5
    ( Page 1 of 4 )

    Among the enhancements that were introduced originally in PHP 5, there’s one powerful extension that has been all but ignored by many programmers until now, quite possibly because they weren’t aware of its existence. Yes, as you might have guessed, I’m talking about the filter library -- a handy set of filters and functions that allow you to validate different types of data with remarkable ease.

    Thus, if you’re interested in learning how to put this group of filters to work for you in a very short time, begin reading this series of articles, since in it you’ll find the right pointers to get you started using the filter library in a true painless fashion.

    However, if you already had the opportunity to read all of the preceding chapters of this series, it’s possible that you now have a pretty solid background in  utilizing this extension. In those tutorials I used several hands-on examples to explain how to validate integers and float numbers, and to check Boolean values by means of a couple of intuitive PHP functions and simple constants.

    Now, speaking more specifically, in the previous article I explained how to use the “filter_var()” function in conjunction with the FILTER_VALIDATE_FLOAT filter to validate floating numbers assigned to a single scalar variable and stored in arrays, which speaks for itself about the versatility of the filter in question.

    Nonetheless, this instructive journey on which we're exploring the capabilities offered by the filter extension doesn’t stop there. In this fifth part of the series, I’m going to discuss the usage of the extension for checking if the value that has been assigned to a given variable follows a specified regular expression pattern.

    That sounds pretty interesting, right? Therefore, if I've caught your attention, then it’s time to continue discovering many other handy validation features provided by the PHP 5 filter library. Let’s get going!



     
     
    >>> More PHP Articles          >>> More By Alejandro Gervasio
     

       

    PHP ARTICLES

    - Adding Ordering and Grouping Clauses to the ...
    - Implementing Factory Methods in PHP 5
    - Merging a File Split for FTP Upload using PHP
    - Getting Data from Yahoo Site Explorer Inboun...
    - Method Chaining: Adding More Selecting Metho...
    - How to Split a File During an FTP Upload Usi...
    - Expanding a Custom CodeIgniter Library with ...
    - Using the Yahoo Site Explorer Inbound Links ...
    - Building a CodeIgniter Custom Library with M...
    - Building an E-mini Trading System Using PHP ...
    - Completing the MySQL Class with Method Chain...
    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek