How could this be done with regex?
return ( $s=='aa' || $s=='bb' || $s=='cc' || $s=='dd' ) ? 1 : 0;
I am trying:
$s = 'aa';
$result = preg_match( '/(aa|bb|cc|dd)/', $s );
echo $result; // 1
but obviously this returns 1 if $s contains one or more of the specified strings (not when it is equal to one of them).