- print_r: documentation ( source)
- array_fill: documentation ( source)
<?php
$i = 0; // menghitung loop
$j = 0; // key untuk $data
$contoh = array_fill(0, 11);
foreach($contoh as $c) {
$temp[$i] = $c;
$i++;
if( ($i % 3) == 0) {
$data[$j] = $temp[$i];
$j++;
}
}
print_r($temp);
print_r($data);