0

I have a string (994)773-2296 or (+919)947-732296.

I want to remove ( , ) , - and + from the above numbers to get the exact phone numbers.

How can I achieve this. Is there any method in php to do so?

2
  • 1
    Also duplicate of stackoverflow.com/questions/2118000/… - How to leave only numbers in a string. Commented Jun 27, 2015 at 9:21
  • str_replace('old', 'new', $yourString); but in your scenario I would suggest preg_replace($pattern, '', $yourString); where $pattern is a Regex pattern that should look something like this: '[\(\)-\+]' Commented Jun 27, 2015 at 9:22

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.