There are a couple formatting scripts out there but not what I'm looking for. ex: 400777666555 what I want: +400 777 666 555 So to add a + and make spaces every 3 numbers.
$number = get_the_author_meta('mobile');
$split = chunk_split($number, 3);
$num = "+" . implode(" ", $split);
The code works only if I delete the last $num line. Not sure what's wrong. If I delete it, it works fine, just without the +.