RE: [PHP] Type of form element

From: Date: Fri, 28 Oct 2005 15:11:05 +0000
Subject: RE: [PHP] Type of form element
Groups: php.general 
Request: Send a blank email to php-general+get-224780@lists.php.net to get a copy of this message
> > Is it possible to loop through all $_POST values to see if it > is a checkbox? > If so then for that element if it is equal to 'on' then > change it to 1 > otherwise change it to 0? foreach($_POST as $key => $value){ if ($value=='on'){$_POST[$key]='1';}elseif($value=='off';){$_POST[$key]='0'}; } JM

« previous php.general (#224780) next »