Try this:
foreach($samplearr as $key => $item){
print "<tr><td>"
. $key
. "</td><td>"
. $item['value1']
. "</td><td>"
. $item['value2']
. "</td></tr>";
}
More Related Contents:
- How to make array inside in foreach loop – php? [closed]
- Can't echo items from array
- PHP Foreach returns separated(individual) arrays
- Strange behavior Of foreach
- Two arrays in foreach loop
- Modify array values in foreach loop
- PHP foreach change original array values [duplicate]
- Performance of FOR vs FOREACH in PHP
- How can I loop through two arrays at once? [duplicate]
- How to access mysql result set data with a foreach loop
- How do you remove an array element in a foreach loop?
- Strange behavior of foreach when using reference: foreach ($a as &$v) { … }
- PHP foreach with Nested Array?
- Foreach loop inside array
- How to delete object from array inside foreach loop?
- What is better in a foreach loop… using the & symbol or reassigning based on key?
- Unsetting array values in a foreach loop [duplicate]
- How to access first level keys of a 2d array with a foreach loop? [duplicate]
- case-insensitive array_unique
- While destructuring an array, can the same element value be accessed more than once?
- php multidimensional array get values
- How to check if variable is array?… or something array-like
- foreach with three variables add
- PHP Multidimensional associative array to HTML table
- I have an array of integers, how do I use each one in a mysql query (in php)? [duplicate]
- How to combine two arrays together?
- How can I echo or print an array in PHP?
- Array to Object and Object to Array in PHP – interesting behaviour
- Find min/max in a two dimensional array
- Remove zero values from a PHP array