fork(1) download
  1. <?php
  2.  
  3. $re = '/(?:\G(?!\A)|\A(?=\d+\z))\d/';
  4. $str = '1234567890';
  5. if (preg_match_all($re, $str, $matches)) {
  6. print_r($matches[0]);
  7. }
Success #stdin #stdout 0.02s 23764KB
stdin
Standard input is empty
stdout
Array
(
    [0] => 1
    [1] => 2
    [2] => 3
    [3] => 4
    [4] => 5
    [5] => 6
    [6] => 7
    [7] => 8
    [8] => 9
    [9] => 0
)