Hi,

RA> for($i=1; $i<21; $i++)
RA> { if(isset($product$i))
RA>  {echo "Product".$i." is set!<br>";}
RA>  else(!isset($product$i))
RA>   {echo "Product".$i." is NOT set!<br>";}}
RA> exit;

...

RA> all of the above give me a parse error.

Your problem is here:

else(!isset($product$i))

You can't put conditions after "else": it is used as the default
option if all other tests fail. You should be using "elseif" instead.

Your choices are:

else
{
    echo "Product" .$i. " is NOT set!<br>";
}

or

elseif(!isset($product$i)
{
    echo "Product" .$i. " is NOT set!<br>";
}

In this case, as it seems to be a boolean test, the first is superior,
I think. The second test adds nothing...

Geoff Caplan
Advantae

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to