Created
October 24, 2014 09:55
-
-
Save dakota/182b3a74b7af988049bb 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 | |
$validator | |
->allowEmpty('number') | |
->add('number', 'valid', [ | |
'rule' => function ($value) { | |
return preg_match('/^(((\+44)? ?(\(0\))? ?)|(0))( ?[0-9]{3,4}){3}$/', $value) === 1; | |
} | |
]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment