Output array values

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Output array values

Post 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.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Output array values

Post 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.
(#10850)
geethalakshmi
Forum Commoner
Posts: 31
Joined: Thu Apr 24, 2008 10:38 pm

Re: Output array values

Post by geethalakshmi »

Hi,
Just look into the following link which might help you.
http://hiox.org/bypass/index.php?id=263
Post Reply