RE: [PHP] go through array
| From: | Ford, Mike [LSS] | Date: | Tue, 17 Jun 2003 18:06:46 +0000 |
| Subject: | RE: [PHP] go through array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-151871@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Diana Castillo [mailto:diana@interhotel.com]
> Sent: 17 June 2003 17:43
>
> I have this array:
> Array ( [2] => 6 [1] => 2 [3] => 2 )
> how do I go through it and get the key and the value in this order?
foreach ($array as $key=>$value)
(See www.php.net/foreach).
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211