Surpressing a 'foreach' Error Message

From: Date: Fri, 06 Feb 2004 22:13:13 +0000
Subject: Surpressing a 'foreach' Error Message
Groups: php.general 
Request: Send a blank email to php-general+get-177055@lists.php.net to get a copy of this message
Hi, I have some check boxes in a form and when the form is submitted I read the checkboxes that have been ticked. However if no checkboxes have been ticked the following line produces an error, is there a way to suppress this? foreach ($project as $project_id => $value) { $fields[] = $project_id; $values[] = $value; } Many thanks

« previous php.general (#177055) next »