Re: Arrays
| From: | John Taylor-Johnston | Date: | Mon, 17 Mar 2003 06:27:51 +0000 |
| Subject: | Re: Arrays | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-139914@lists.php.net to get a copy of this message | ||
Thanks!
"John W. Holmes" wrote:
> > $var = array (
> > 'AN' => array (
> > 'Description' => 'Accession Number: (AN)',
> > 'ReferenceURL' => 'AN__Accession_Number.jsp',
> > ),
> > 'AU' => array (
> > 'Description' => 'Author(s): (AU)',
> > 'ReferenceURL' => 'AU__Author(s).jsp',
> > )
> > )
> >
> > What I want to get is the keys 'AN' and 'AU' as values.
> >
> > while (??){
> > echo "This key is $var[??]<br>";
> > }
> >
> > This key is AN
> > This key is AU
>
> foreach($var as $key => $value)
> { echo "The key is $key"; }
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
--
John Taylor-Johnston
-----------------------------------------------------------------------------
"If it's not open-source, it's Murphy's Law."
' ' ' Collège de Sherbrooke:
ô¿ô http://www.collegesherbrooke.qc.ca/languesmodernes/
- Université de Sherbrooke:
http://compcanlit.ca/
819-569-2064