I don’t want to import blank/empty, space, null value on my database. So for this reason I want to check my input value before importing on database. Please any one can tell me isset and empty function which one is good for checking input value. here is my code. Thanks
$required = array('login', 'password', 'confirm', 'name', 'phone', 'email');
$error = false;
foreach($required as $field) {
if (empty($_POST[$field])) {
$error = true;
}
}
if ($error) {
echo "All fields are required.";
} else {
echo "Proceed...";
}
Fix it: