for($i=0;$i < length($string)/$len; $i++) { $codons[$i] = substr($string,$i*$len,$len); }