lundi 3 février 2020

Multiple Queries in if stament in PHP

I want to know if a code like this in valid in PHP .. what i am trying to do is use OR (||) and OR (&&) in an if statement in PHP here is my code.

if ( (isset($_POST['submit_name']) && !empty($_POST['name'])) || (isset($_POST['submit_chat']) && !empty(trim($_POST["message"])) || !empty($_FILES['upload'])) ) {
// code here...
} else {
//else code here...
}

Aucun commentaire:

Enregistrer un commentaire