<?php
$s = '1234';
preg_match_all('/(?=(.+$)).?/', strrev($s), $m);
foreach(range(sizeof($m[1]), 0) as $i) print strrev($m[1][$i]) . "\n"; 
?>