php - OR Condition check multiple values possible? -


i have no idea m looking called m asking if there way in php check if 1 of multiple hardcoded value true

what mean is, possible write following condition

if($var == 'this' || $var == 'orthis') //this can become long 

by writing similar following

if($var == 'this'||'orthis') //skiping "||$var == " every value want check 

i know technically write following

if(in_array($var,array('this','orthis'))) 

but currious know if there second line.

thanks!

you're looking syntax in operator in sql. unfortunately there no syntax that, other tricks using in_array, suggested yourself.


Comments