Answer the question
In order to leave comments, you need to log in
A pattern for a mobile phone?
Help compose a regular expression for a mobile phone with +. Everything I searched on Google doesn't work. I try like this:
if (preg_match('^\+\d{7,15}$', $_GET['num'])) echo 'ok';
else echo 'error';
if (preg_match("/^\+\d{7,15}$/", $_GET['num'])) echo 'ok';
else echo 'error';
Warning: preg_match(): No ending delimiter '^' found
, in the second error
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question