The following line in my code
while(list($key,$value) = each($ar))
sometimes generates a PHP warning:
Variable passed to each() is not an array or object
I'm guessing this is a result of $ar sometimes not being set (normal behavior as the variable is based on user input from an html form).
Do I need to enclose the while loop inside an if statement checking on whether $ar exists, or is there a more elegant solution?