I am working on an SMS app and need to be able to convert the sender\'s phone number from +11234567890 to 123-456-7890 so it can be compared to re
It's faster than RegEx.
$input = "0987654321"; $output = substr($input, -10, -7) . "-" . substr($input, -7, -4) . "-" . substr($input, -4); echo $output;