<?php $string = "0001000200030004"; $str = str_split($string, 4); for($i=0;$i<=count($str);$i++){ echo $str[$i]."<br />"; } ?>