I want to show an error when the variable is BLANK or EMPTY or NULL. for example, the variable is shown below:
$mo = strtotime($_POST['MondayOpen']);
and
var_dump($_POST['MondayOpen'])returnsstring(0) "".
Now i'm coming with the approach
I did a test with $moand got these results
is_int($mo);//--Return nothing
is_string($mo); //--Return bool(false)
var_dump($mo); //--Return bool(true)
var_dump(empty($mo));//--Return bool(true)
var_dump($mo==NULL);//--Return bool(true)
var_dump($mo=='');//--Return nothing
Please suggest an optimal and correct approach for checking the integrity of a variable
source
share