Home arrow PHP arrow A PHP Validation Helper Class in Action

A PHP Validation Helper Class in Action

If you’re an enthusiastic PHP developer interested in learning how to build helper classes, you've come to the right place. This article series will teach you in a few simple steps how to build several kinds of helper classes for manipulating strings, generating dynamic URLs and validate incoming data, and so forth.

TABLE OF CONTENTS:
  1. A PHP Validation Helper Class in Action
  2. Review: the previous ValidatorHelper class
  3. Checking integers and float numbers with the ValidatorHelper
  4. Validating alphabetic and alphanumeric values, IP and e-mail addresses, and URLs
By: Alejandro Gervasio
Rating: starstarstarstarstar / 3
August 31, 2009

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Welcome to the penultimate tutorial of the series on building helpers in PHP 5. Comprised of eight articles, this series provides you with the basic pointers to start creating your own helper classes with minor hassles, and complements the corresponding theory with a great variety of hands-on examples.

And now that you've been introduced to the aim of this series of articles, it’s time to review the topics that were treated in the last part. In that installment I finished building a simple helper class that could validate different types of data, including numeric and float numbers, IP and email addresses, and URLs as well.

The functionality of each method of this class was based mostly on PHP filters, since this extension not only permits you to perform a decent validation on incoming data, but it makes this a no-brainer process.

However, if you’re anything like me, then you may want to see how this validation helper class can be used in concrete situations, right? Well, in this tutorial I’m going to develop some basic examples that will illustrate the real capabilities of the class for verifying all the types of data mentioned above.

So, now it’s time to leave the preliminaries behind us and start evaluating this sample helper class through some concrete and easy-to-grasp examples. Let’s jump in!



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

blog comments powered by Disqus
   

PHP ARTICLES

- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...
- PHP: Building Concrete Validators
- Sanitizing Input with PHP
- Executing Shell Commands with PHP
- Handling File Data with PHP
- File Security and Resources with PHP
- ArrayObject PHP Class Examples
- ArrayObject PHP Class: An Introduction
- Getting File System Data with PHP
- PHP Tools for Working with the File and Oper...
- Working with the File and Operating System w...
- PHP Proxy Patterns: Completing a Blog


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 4 - Follow our Sitemap

Dev Shed Tutorial Topics: