0
I need to go all the way array multidimensional with each
and list
only. This is the code:
$Carros = array(
array("BMW", 130000, "Novo"),
array("Strada", 40000, "Usado"),
array("CRUZE", 100000, "Semi-novo")
);
0
I need to go all the way array multidimensional with each
and list
only. This is the code:
$Carros = array(
array("BMW", 130000, "Novo"),
array("Strada", 40000, "Usado"),
array("CRUZE", 100000, "Semi-novo")
);
Browser other questions tagged php array
You are not signed in. Login or sign up in order to post.
And as you tried to do?
– Woss
Well, I know how to do it in a simple array, but in a multidimensional array, I have no idea how to do it. I did some research and didn’t find much, so I would like to know how it works in a multidimensional array
– João Victor
You will need to make two loops: one to traverse the values of
$Carros
, another to traverse all values of each line of$Carros
.– Woss
I use two eachs for this?
– João Victor
Yes, in separate loops.
– Woss
There’s a way I can do this without looping loop
– João Victor
What are the ways to iterate an array in PHP (without foreach)?
– Woss