There are strings in table
+1-123-456-7890
11234567890
+1 1234567890
1777555999
I have variable $phoneNumber. I want to pass variable in sql query to get matching records.
example:
$phoneNumber holds the value 1234567890
and using same variable I want to fetch following records in one query
+1-123-456-7890
11234567890
+1 1234567890
I want to select both records in one query. how can I match data (11234567890) with above saved numbers?


REPLACE(REPLACE(REPLACE(telephone, ' ', ''), '+', ''), '-', '') LIKE $telephone+,-, and spaces, only the middle number is an exact match.$phoneNumbervalue is any of the following +1-123-456-7890 11234567890 +1 1234567890 all number should be treated as same because they have same number if ' ', '-', '+' characters not considered.