Answer the question
In order to leave comments, you need to log in
PHP. How to display the contents of this array in two columns?
Good afternoon.
Can you please tell me how to display the contents of this array in two columns? thanks in advance
array(3) { [0]=> array(2) { [0]=> string(8) "Suprotec" [1]=> string(13) "4660007120727" } [1]=> array(2) { [0]=> string(5) "Osram" [1]=> string(12) "LEDCBCTRL101" } [2]=> array(2) { [0]=> string(7) "Hi-Gear" [1]=> string(6) "HG5742" } }
Answer the question
In order to leave comments, you need to log in
$array = [1 => "one", 2 => "two", 4 => "four", 5=> "five", 6 => "six"];
$array = array_chunk($array, count($array)/2);
$first = array_shift($array);
$second = array_reduce($array , "array_merge", []);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question