fork(1) download
  1. <?php
  2. $s = '1234';
  3. preg_match_all('/(?=(.+$)).?/', strrev($s), $m);
  4. foreach(range(sizeof($m[1]), 0) as $i) print strrev($m[1][$i]) . "\n";
  5. ?>
Success #stdin #stdout 0.02s 13064KB
stdin
Standard input is empty
stdout
1
12
123
1234