I would like to validate a phone number.
In JavaScript I tried it with /^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\s\./0-9x]*$/
and it works great.
The same Regex I have used for PHP ...
if (preg_match("/^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\s\./0-9x]*$/", $_POST['phone'])) { ... }
but that doesn't work and returns:
Warning: preg_match(): Unknown modifier '0'
What am I doing wrong?