Is there a shortcut to check if none of the values in the array are empty. I don’t want to have to list it out one by one.
$form_inputs = array (
'name' => $name,
'gender' => $gender,
'location' => $location,
'city' => $city,
'description' => $description);
if (!empty(XXXXXXXX)){
echo 'none are empty';
} else {
header('Location:add.school.php?error=1');
exit();
}
Use in_array:
in_arraywill recognize'',null,0,falseas empty, so it may not work too well, depending on your values. This is typically good for checking string arrays.