Created
February 16, 2012 15:02
-
-
Save Awilum/1845461 to your computer and use it in GitHub Desktop.
Tweevalid - php validator in less that 140 bytes
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
$valid = new Tweevalid(); | |
var_dump($valid->email('test@test.com')); | |
var_dump($valid->url('http://test.com')); | |
var_dump($valid->ip('10.10.10.10')); |
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
class Tweevalid{function __call($v,$a){$m=array('email'=>274,'ip'=>275,'url'=>273);return filter_var($a[0],$m[$v]);}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment