<?php

$x = preg_replace("/(((\\d)\\d)\\d)/", '1=$1, 2=$2, 3=$3   ', "123456 789");
echo $x;
