I have an array like this:
Array(
[0] => Array(
[0] => Orange,
[1] => Mango,
[2] => Banana
)
[1] => Array(
[0] => Orange Tree
[1] => Banana Tree
)
)
How can i do it like below without using like Array[1][2] = mango tree
:
Array(
[0] => Array(
[0] => Orange,
[1] => Mango,
[2] => Banana
)
[1] => Array(
[0] => Orange Tree
[1] => Banana Tree
[2] => Mango Tree
)
)
That means that I have to insert this without using Array[1][2] = Mango tree
or something like that. I want a way which can be used in foreach
loops.
$myArray[1][] = 'Mango Tree'
at the moment.