I have a couple of phonenumbers listed in my database with a certain way of writing.
I want to have a space after every two numbers. I thought I would do:
$numbers = '06-12345678';
$regex = '/(\\d{2})(\\d{1})(\\d{2})(\\d{2})(\\d{2})(\\d{2})/';
$result = preg_replace($regex, '$1 $2 $3 $4 $5 $6', $numbers);
echo $result;
But this doesn't work. It just places all the numbers next to each other.
My Expected Output:
06 - 12 34 56 78