kk at shonline dot de
30-Jul-1998 08:22
When used on a scalar or unset value, reset() spews warning messages. This
is often a problem when accessing arrays generated from HTML form input
data: these are scalar or unset if the user didn't enter sufficient
information.
You can silence these error messages by prefixing an
@ (at sign) to reset(), but it is better style to protect your reset() and
the following array traversal with an if (isset()). Example
code:
if (isset($form_array)) {
reset($form_array);
while (list($k, $v) = each($form_array) {
do_something($k,
$v);
}
}