Source for file validtester.php

Documentation is available at validtester.php

  1. <?php
  2. /**
  3. * test the validity of data according to a set of rules
  4. *
  5. @author    Stuart Prescott
  6. @copyright  Copyright Stuart Prescott
  7. @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  8. @version    $Id$
  9. @package    Bumblebee
  10. @subpackage FormsLibrary
  11. */
  12.  
  13. /** Load ancillary functions */
  14. require_once 'inc/typeinfo.php';
  15.  
  16. /** type checking and data manipulation */
  17. require_once 'inc/typeinfo.php';
  18.  
  19. /**
  20. * check if data is valid
  21. *
  22. @param string $validator   name of a function to call
  23. @param mixed  $data        data to be validated (string, number, array etc)
  24. @param integer $DEBUG      (optional) debug level for extra data output
  25. @return boolean data is valid
  26. */
  27. function ValidTester($validator$data$DEBUG=0{
  28.   $isValid 1;
  29.   if (isset($validator&& is_callable($validator)) {
  30.     $isValid $validator($data);
  31.   }
  32.   if ($DEBUG 9echo "[$data$validator$isValid]";
  33.   return $isValid;
  34. }
  35.  
  36. ?>

Documentation generated on Tue, 06 Mar 2007 10:02:10 +0000 by phpDocumentor 1.3.0