function check_fields($_POST)
{
// provide $_post['field1'],$_post['field2']..so on
foreach($_POST as $_POST['FIELD 1-N']
{
isvalid($_POST['FIELD1 - N']);
}
}
// Sample $_POST array
$_POST = array(
"field1" => "", // this is not set
"field2" => "data"
);
foreach($_POST as $key => $field) {
// You can check if it is empty using foreach alone
if (strlen($field) > 0) {
// this field is set
} else {
// this field is not set
}
}