UKPhoneValidator is an extension for validation of United Kingdom phone numbers in all possible ways.
Requirements
Yii 1.0 or above
Usage Extract UKPhoneValidator.php to your extension directory. The following model code validates attribute in UKPhoneValidator:
public function rules()
{
return array(
array('phone', 'application.extensions.UKPhoneValidator')
);
}
Also allowEmpty can be set and message for empty entry. Resources
- Project page https://github.com/ineersa/UKPhoneValidator
Good idea
And I add the french version, based on yours and on regexps I'm used to use.
Great job.
Well i have alot of validations for different countries and attributes. They made to serious data marketing platform, so if it will be interesting i'll add them whe will have some free time.
it's interesting
I'm really interested in that, I've fighting with international phones recognition for years, I think I've some of my rules in an old archive too, I'll compare them with yours.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.