Answer the question
In order to leave comments, you need to log in
How to split a multidimensional array into many one-dimensional ones?
In general, at the input I get an array of this kind
Array (
[0] => Array (
[0] => Вася
[1] => Петя
[2] => Саня
)
[1] => Array (
[0] => 16
[1] => 25
[2] => 55
)
[2] => Array (
[0] => школьник
[1] => программист
[2] => инженер
)
)
Array (
[0] => Вася
[1] => 16
[2] => школьник
)
Array (
[0] => Петя
[1] => 25
[2] => программист
)
Array (
[0] => Саня
[1] => 55
[2] => инженер
)
Answer the question
In order to leave comments, you need to log in
and what are the difficulties? do for you?
float:left; and that's it
codepen.io/Geyan/pen/PzJbzZ?editors=110 then train yourself
Flood.
What is difficult in this layout?
Absolutely simple layout.
Just try to save subarrays using variable variables.
Your array:
$arrays = Array (
'0' => Array (
'0' => 'Вася',
'1' => 'Петя',
'2' => 'Саня'
),
'1' => Array (
'0' => '16',
'1' => '25',
'2' => '55'
),
'2' => Array (
'0' => 'школьник',
'1' => 'программист',
'2' => 'инженер'
)
);
foreach ($arrays as $i =>$array) {
${"array{$i}"} = $array;
}
Array
(
[0] => Вася
[1] => Петя
[2] => Саня
)
Array
(
[0] => 16
[1] => 25
[2] => 55
)
Array
(
[0] => школьник
[1] => программист
[2] => инженер
)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question