I have an array that has some other arrays inside it:
if I print_r($u) I get:
Array
(
[0] => Albany
)
Array
(
[0] => Albany
Array
(
[0] => Albany
[41] => Albuquerque
)
Array
(
[0] => Albany
[41] => Albuquerque
)
Array
(
[0] => Albany
[41] => Albuquerque
[54] => Atlanta
)
Array
(
[0] => Albany
[41] => Albuquerque
[54] => Atlanta
)
Array
(
[0] => Albany
[41] => Albuquerque
[54] => Atlanta
[93] => Auckland
[94] => Augusta
)
Array
(
[0] => Albany
[41] => Albuquerque
[54] => Atlanta
[93] => Auckland
[94] => Augusta
)
...
The last array has about 20 elements. I need only that last array. Hope this is not too confusing.
You can use the
end()function:Keep in mind that calling
end()will change the internal array pointer. If you don’t want that to happen, you could do: