Código PHP:
Ver original$str='dfghjklkjhg';//<-tu.cadena
$c=2;//<-caracteres.a.cortar
for($i=0;$i<$l;$i+=$c){
}
//imprime: df,gh,jk,lk,jh,g
//modificando el valor de $c a 3, imprime: dfg,hjk,lkj,hg
//modificando el valor de $c a 4, imprime: dfgh,jklk,jhg