while ($field = each($_POST)) { if (empty($field['value'])) unset(current($_POST)); } // $test case is all of the fields posted by my HTML form. $testcase = array("address", "phone", "email", "address", "city", "state", "zip"); $postkeys = array_keys($_POST); $missingfields = array_diff($testcase, $postkeys); print_r $missingfields; }