PHP foreach loop through multidimensional array
问题 I have an array: $arr_nav = array( array( "id" => "apple", "url" => "apple.html", "name" => "My Apple" ), array( "id" => "orange", "url" => "orange/oranges.html", "name" => "View All Oranges", ), array( "id" => "pear", "url" => "pear.html", "name" => "A Pear" ) ); Which I would like to use a foreach loop to replace (which only allows me to set the number: for ($row = 0; $row < 5; $row++) with the ability to display a .first and .last class for the relevant array values Edit I would like the