Logic - checking if at least one field is not zero
1 answer
Yes, sorry for the following work:
$array = array();
if($_POST){
foreach ($_POST as $key => $value){
if (!empty($value)){
$array[$key] = $value;
}
}
if (empty($array))
{
echo 'array empty';//throw error
} else {
echo 'array not empty'; //there is a submission
}
}
EDIT: missed the closing tag in paste .... fixed
+1
source to share