Answers for "php check if multiple inputs are empty"

PHP
1

php check if specific input empty

/*
  =============Input Type File=============
*/
$is_uploading = $_FILES["inputfilename"]["error"];
/*
  the variable $is_uploading has value either 0 or 4
  0 => the user is uploading specific files or images
  4 => user is not uploading anything
*/
$can_pass = $is_uploading == 0 ? true : false;
if($can_pass){
  echo "You can Pass";
}
else{
  echo "Please upload. Your request has empty files.";
}
Posted by: Guest on June-12-2021
0

php check if multiple inputs are empty

foreach ($_POST as $key => $value) {
    if (empty($value)) {
        //Code to run
    }
}
Posted by: Guest on May-03-2021

Code answers related to "php check if multiple inputs are empty"

Browse Popular Code Answers by Language