<?php
//Enter your code here, enjoy!
$array = array(
"1" => "PHP code tester Sandbox Online",
"foo" => "bar", 5 , 5 => 89009,
"case" => "Random Stuff: " . rand(100,999),
"PHP Version" => phpversion(),
"1" => "PHP code tester Sandbox Online",
"foo" => "bar", 5 , 5 => 89009,
"case" => "Random Stuff: " . rand(100,999),
"PHP Version" => phpversion(),
"1" => "PHP code tester Sandbox Online",
"foo" => "bar", 5 , 5 => 89009,
"case" => "Random Stuff: " . rand(100,999),
"PHP Version" => phpversion(),
"1" => "PHP code tester Sandbox Online",
"foo" => "bar", 5 , 5 => 89009,
"case" => "Random Stuff: " . rand(100,999),
"PHP Version" => phpversion(),
);
$counter = 0;
$x = 3;
foreach( $array as $key => $value ){
if($counter++ % $x ==0){
echo "[START-DIV]" . PHP_EOL;
}
echo $value . PHP_EOL;
if($counter % $x ==0){
echo "[END-DIV]" . PHP_EOL;
}
}
http://sandbox.onlinephpfunctions.com/code/9a12d861efe02296c9ff40ad832585e20a9a2ba5
Mam nadzieje, że nakieruje cie na dobre rozwiązanie.
Co do samego kodu mam wiele zastrzeżeń.