$last = count($arr_nav) - 1;
foreach ($arr_nav as $i => $row)
{
$isFirst = ($i == 0);
$isLast = ($i == $last);
echo ... $row['name'] ... $row['url'] ...;
}
More Related Contents:
- Looping a multidimensional array in php
- Checking if array is multidimensional or not?
- Loop a multidimensional array and only print two specific column values per row
- in_array() and multidimensional array
- What is the best way to loop through this array in PHP?
- Sum values of multidimensional array by key without loop
- Sorting a php array of arrays by custom order
- PHP Foreach Pass by Reference: Last Element Duplicating? (Bug?) [duplicate]
- How do I sort a multidimensional array by one of the fields of the inner array in PHP? [duplicate]
- Sort array of objects by one property
- String with array structure to Array [duplicate]
- Restructure multidimensional array of column data into multidimensional array of row data [duplicate]
- Implode a column of values from a two dimensional array [duplicate]
- Recursively remove empty elements and subarrays from a multi-dimensional array
- PHP remove duplicate values from multidimensional array
- PHP combine two associative arrays into one array
- using array_search for multi dimensional array
- Dynamic array keys
- How do i count same values in an array and store it to a variable?
- sum specific values in a multidimensional array (php)
- Merge two indexed arrays of indexed arrays based on first column value
- Group 2d array data using column value to create a 3d array
- case-insensitive array_unique
- How to set an option from multiple options or array with different values to views as selected in select box using PHP
- Combine two 2d arrays and have duplicate rows removed
- Recreate original PHP array from print_r output [duplicate]
- PHP convert nested array to single array while concatenating keys?
- Group array data on one column and sum data from another column to form a flat associative array
- Convert delimited string into array key path and assign value
- PHP: Check for duplicate values in a multidimensional array