mercredi 5 septembre 2018

I am not understanding why this is happening with empty php variables

I try to do this:

if ($var !== ""){
    $message = "whatever";
}

But end up having to do this:

if ($var == ""){
    //do nothing
} else {
    $message = "whatever";
}

Why does that happen? Shouldn't both of those mean the same thing?

Aucun commentaire:

Enregistrer un commentaire