I have an array:
$arr_nav = array( array( \"id\" => \"apple\",
\"url\" => \"apple.html\",
\"name\" => \"My Apple\"
),
If you mean the first and last entry of the array when talking about a.first and a.last, it goes like this:
foreach ($arr_nav as $inner_array) {
echo reset($inner_array); //apple, orange, pear
echo end($inner_array); //My Apple, View All Oranges, A Pear
}
arrays in PHP have an internal pointer which you can manipulate with reset, next, end. Retrieving keys/values works with key and current, but using each might be better in many cases..