| benton |
06-28-2009 08:05 PM |
Quote:
Originally Posted by Wildhoney
(Post 26227)
This should do it for you, amigo:
php Code:
foreach ($myArray as $key => $value){ echo $key . ': ' . $value[ 'id'] . ' - '. $value[ 'text'] . '</br>'; }
|
That doesn't seem to do it but maybe I missing sometihng obvious. It I run the above, the output is So it got the array name but not the contents of that array. I then thought to try this:
PHP Code:
foreach ($myArray as $key)
{
echo $key.'<br>';
foreach ($key as $value)
echo $key . ' - '. $value['id'].' - '.$value['text'].'<br>';
}
But it doesn't get the name of the array. The output is
Quote:
Array
Array - 15 year - 15 Years
Array - 20 year - 20 Years
Array - 25 year - 25 Years
|
Is there a way to have both the array name and its contents printed?
|