RE: [PHP] run through array with list only once? From: Matthew Loff (matt <email protected>)
Date: 10/15/01

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 <email protected>]
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 <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>

-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>