<?php $re = '/(?:\G(?!\A)|\A(?=\d+\z))\d/';$str = '1234567890';if (preg_match_all($re, $str, $matches)) { print_r($matches[0]);}
Standard input is empty
Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 [6] => 7 [7] => 8 [8] => 9 [9] => 0 )
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!