fork download
  1. <?php
  2.  
  3. $x = preg_replace("/(((\\d)\\d)\\d)/", '1=$1, 2=$2, 3=$3 ', "123456 789");
  4. echo $x;
  5.  
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
1=123, 2=12, 3=1   1=456, 2=45, 3=4    1=789, 2=78, 3=7