PHP
  Home arrow PHP arrow Validating Octal and Hexadecimal Values 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

Validating Octal and Hexadecimal Values with Filters in PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 1
    2009-07-22


    Table of Contents:
  • Validating Octal and Hexadecimal Values with Filters in PHP 5
  • Review: the FILTER_VALIDATE_INT filter
  • Filtering array elements
  • Validating octal and hexadecimal integers using the flags option

  • 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


    Validating Octal and Hexadecimal Values with Filters in PHP 5
    ( Page 1 of 4 )

    As you know, when it comes to validating incoming data, PHP 5 comes bundled with a powerful set of native functions that allow you to perform all sorts of clever validations on a given variable. This includes checking for numeric values, arrays, strings, and objects as well. However, the best feature of the helpful validation capabilities offered by default by PHP 5 is its handy filter extension, even though it has been overlooked by many programmers so far.

    Indeed, this library of filters also permits you to perform powerful validation on variables in a pretty straightforward fashion, without the need to define custom and complex functions. So, if you’re interested in learning how to use these filters within your own web applications, then this group of articles might be the material that you’re looking for.

    Logically, if you already had the chance to read the introductory installment of this series, then at this point you’ll have a fairly clear idea of how to use the filter extension for validating integers. In that specific tutorial I coded a few basic examples that demonstrated how to carry out this task by using the FILTER_VALIDATE_INT filter in conjunction with the “filter_var()” function.

    Not only did this filter allow us to check whether a given value was an integer or not, but it permitted us to determine if the value in question was within a specified range. This extra functionality was implemented via an additional “option” array, which was passed to the aforementioned “filter_var()” function.

    However, I’m only scratching the surface when it comes to exploring the numerous capabilities offered by the filter extension. Therefore, in this second chapter of this series, I’m going to discuss how to use the FILTER_VALIDATE_INT filter that you learned in the previous part, this time for validating array elements as well as octal and hexadecimal integers.

    Does this sound complex to you? It won’t be at all, trust me. Now, let’s get rid of the preliminaries and continue exploring the useful validation capacities of the filter PHP 5 extension!



     
     
    >>> 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