There is an in_array function.
if(in_array($a, array('are','abc','xyz','lmn'), true)){ echo 'true'; }
Note: You must set the 3rd parameter to true
order to use strict comparison.
in_array(0, array('are','abc','xyz','lmn'))
will return true
, this may not be the way you expected.
source share