Answer the question
In order to leave comments, you need to log in
How to form an array from the values of other arrays?
Hai. Help me come up with an implementation to create an array.
It is necessary to collect another from the values of some arrays. How to implement this is shown in the figure below. Thank you.
Answer the question
In order to leave comments, you need to log in
php 5.6+
function compose_arrays(...$arrays){
foreach($arrays as $array){
for($i = 0; $i < count($array); $i++){
$array_out[$i][] = $array[$i];
}
}
return $array_out;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question