I am setting up a Click2Call app for my new website. I am trying to keep only numbers that start with specific digits (defined in an array) so that I don't end up being pranked and calling premium numbers in Asia or anywhere else.
Here is my regex:
And here's the code that generates it:
$c2cregexp = "/^(" . str_replace("+","\+",implode ( '|', $authorized_numbers )). ")/i";
print_r(preg_match ($c2cregexp , $_GET['num'] ), $other)
$_GET['num'] was set to +447xxx (xxx where actual digits), then +447, with no match.
This is not my final code obviously, only the first step to test my regex against sample numbers. The whole thing doesn't seem to working so far (result is "0") and a bit of help would be appreciated.
Thank you in advance