Skip to content

Instantly share code, notes, and snippets.

@Awilum
Created February 16, 2012 15:02
Show Gist options
  • Save Awilum/1845461 to your computer and use it in GitHub Desktop.
Save Awilum/1845461 to your computer and use it in GitHub Desktop.
Tweevalid - php validator in less that 140 bytes
$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'));
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