Hi,
im making my new CakePHP project and I've got some problems with validating data, which comes from form. I mean i do know how to add custom rule but i don't know how should regex for 9 numeral telephone number looks like.
function checkPolishNumber($inputValue){
$regex = 'what to put here?';
if(!empty($inputValue['ask_telefon'])) {
return preg_match($regex, $inputValue['ask_telefon']);
}
else {
return true;
}
}
I think it should let through something like this:
+48 111 222 333
111 222 333
111-222-333
111222333
Is it possible to write regex like this?
P.S. Sorry for my creepy english.
Best regards,
Jola