Page 1 of 1

Output array values

Posted: Wed Apr 09, 2008 5:40 am
by aceconcepts
Hi,

I have the following array:

Array ( [0] => Array ( [title] => Accommodation [description] =>Hotel [number] => 1 ) )

Is there a more efficient way of outputting the array values rather than using nested foreach loops:

Code: Select all

 
foreach(...)
{
   foreach(...)
   {
 
   }
}
 
Thanks.

Re: Output array values

Posted: Wed Apr 09, 2008 10:51 am
by Christopher
Not really. There are array functions like array_walk() that are useful in some circumstances. And there are print_r(), var_dump(), var_export() for displaying the contents of the variables.

Re: Output array values

Posted: Thu Apr 24, 2008 11:17 pm
by geethalakshmi
Hi,
Just look into the following link which might help you.
http://hiox.org/bypass/index.php?id=263