Reputation: 909
expected_Phone_number: (888) 888-8888
actual_phone_number: (888) 888-8888
How do I use Preg_match to check if the 2 numbers match.(I need to check if the 2 phone numbers match exactly)
Upvotes: 1
Views: 194
Reputation:
If php supports \Q .. \E
, something like
'~^\Q' . $phone_number_expected . '\E$~';
otherwise regex escape the phone number
'~^' . preg_quote($phone_number_expected, '~') . '$~';
or just do a string compare
Upvotes: 1