Re: Array Question

From: Date: Fri, 17 Nov 2000 10:17:54 +0000
Subject: Re: Array Question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-25885@lists.php.net to get a copy of this message
you should write a quick little recursive function... something like this: function trav_array($array) { while (list($key, $val) = each(array)) { if (is_array($val)) trav_array($val)); else print "$key $val\n"; } } Hopefully you get the idea.. I just whipped this up quick... You'll probably want to change it to your needs. -jeremy brand http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more --------------------------------------------------------------------- We cannot do everything at once, but we can do something at once. -- Calvin Coolidge On Fri, 17 Nov 2000, Kevin Leavell wrote: > Date: Fri, 17 Nov 2000 02:30:49 -0700 > From: Kevin Leavell <k@bigsky.net> > To: php-general@lists.php.net > Subject: [PHP] Array Question > > I am trying to loop through an array with: > while(list($key, $value) = each($AddressInfo)) > { > print("$key is $value &lt;br&gt;\n"); > } > > I am getting: > Name_Prefix is Array<br> Name_First is Array<br> > > I need all the values of the array but am not sure how to access them. > > Thanks in advance. > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#25885) next »