jeudi 1 juin 2017

PHP - How to simplify conditions? [duplicate]

This question already has an answer here:

Just a little question, how to simplify this without using ternary :

if($a == "b" OR $a == "c" OR $a == "d")

I tried :

if($a == ("b" || "c" || "d")) 

but it doesn't work :D

What's the good syntax please ? Thanks !

Aucun commentaire:

Enregistrer un commentaire