Skip to content

Instantly share code, notes, and snippets.

@VictorFursa
Created August 19, 2015 20:59
Show Gist options
  • Save VictorFursa/ac0609c3465a8dc962d9 to your computer and use it in GitHub Desktop.
Save VictorFursa/ac0609c3465a8dc962d9 to your computer and use it in GitHub Desktop.
$numbers = 100;
$a = array();
$z = array();
$x = array();
$array1 = array();
$array3= array();
$buffer = array();
for($i = 0; $i <= $numbers;$i++){
$a[] = $i;
}
for($i = 1; $i < count($a);$i++){
if($a[$i] %2){
$z[]= $a[$i];
$array1[0]=$z;
} if($a[$i] % 2 == 0){
$x[]= $a[$i];
$array1[1]=$x;
}
}
for($i= 0;$i < count($array1); $i++){
for($j=0;$j < count($array1[$i]);$j=$j+5){
$buffer[][] = $array1[0][$j];
}
$array3 = $buffer;
}
var_dump($array3);
типа 1 ячейка сделана только пернести надо в многомерный массив
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment