RE: [PHP] run through array with list only once?
| From: | Matthew Loff | Date: | Mon, 15 Oct 2001 22:52:53 +0000 |
| Subject: | RE: [PHP] run through array with list only once? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-71152@lists.php.net to get a copy of this message | ||
Your question is pretty vague, we could use some sample code...
Ways to iterate arrays:
foreach($array as $array_item)
{
echo $array_item;
}
while(list($item1) = each($array))
{
echo $item1;
}
for($i = 0; $i < sizeof($array); $i++)
{
echo $array[$i];
}
-----Original Message-----
From: Tom Beidler [mailto:tom@orbittechservices.com]
Sent: Monday, October 15, 2001 6:32 PM
To: php list
Subject: [PHP] run through array with list only once?
Can you run through an array in a while loop listing each element only
once?
I'm trying to run through an array 6 different times and it only works
on
the first attempt. I'm not using functions so I don't think I can make
it
global. How can I run through it more then once?
Tom
--
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