Created
May 31, 2010 12:31
-
-
Save ixti/419789 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// via wiping out possible options of validator | |
$validate = new Zend_Validate_Callback('is_numeric'); | |
$validate ->setOptions(array()); | |
// via create_function() callback | |
$callback = create_function('$v', 'return is_numeric($v);'); | |
$validate = new Zend_Validate_Callback($callback); | |
// via anonymous function callback (for PHP >= 5.3) | |
$validate = new Zend_Validate_Callback(function($v){ | |
return is_numeric($v); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment