- var_dump: documentation ( source)
- is_numeric: documentation ( source)
- in_array: documentation ( source)
<?php
$data = ['staffId' => '1111', 'password' => ''];
foreach($data as $key => $val) {
$d[$key] = $val;
$boolVal[] = ($d[$key] === '') ? FALSE : TRUE;
}
$valiA = (in_array(FALSE, $boolVal, true)) ? FALSE : TRUE;
if($valiA) {
foreach($data as $key => $val) {
$d[$key] = $val;
$boolval[] = is_numeric($d[$key]);
}
$valiB = (in_array(FALSE, $boolval, true)) ? FALSE : TRUE;
var_dump(($valiB) ? $data : FALSE);
}