mercredi 3 août 2016

Are empty curly brackets, in if statements ok?

This code works for what I want, but I'm wondering if it's ok to do nothing inside the curly brackets of an if statement. Is there a better way to write this?

if(empty($data) || $data == "unanswered")) {
//do nothing
} else {
    //display data
    echo $data;
}

Aucun commentaire:

Enregistrer un commentaire