dimanche 27 août 2017

PHP check variable against an array of values with or operator

So i have this array of values

$veg = array('tomatoes', 'potatoes');

How do i check this array against my variable but with "or" operator

Something like

if if ($veggies == ('tomatoes' || 'potatoes'))  {
 ...
}

but i have no idea how to use my array there

Aucun commentaire:

Enregistrer un commentaire