$A = array(3,8,9,6,7); $K = 3; $F = sizeof($A)%$K; $R = sizeof($A) - $F; for($i=0;$i<$R;$i++){ $ni = $i; $oi = $i+$F; $new[$ni] = $A[$oi]; } for($i=0;$i<$F;$i++){ $ni = $F+$i+1; $oi = $i; $new[$ni] = $A[$oi]; } print_r($new); } Array ( [0] => 9 [1] => 6 [2] => 7 [3] => 3 [4] => 8 )