Hi,

i'm on PHP training and our lector is telling us that to avoid counting an
array item amout thanks count($my_array), he tells we can do:
while($my_array)
{
 ... do something
}
but from experience this is an infinity loop...

it should be always something like
$count = count($my_array);
while($i <= $count)
{
...
do something
...
$i++;
}

has someone already use such syntax ? i mean as the first one.
thx.

-- 
Alain
------------------------------------
Windows XP SP3
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008

Reply via email to