Ignore my solution hasty and wrong.
On 7/2/07 3:07 PM, "Cliff Hirsch" <[EMAIL PROTECTED]> wrote:
> in_array($value, $options, true) solves issues with type conversion (like
> foobar¹ == (int)0)
>
> But what about the equivalent for a key search?
>
> array_key_exists ( mixed key, array search
in_array($value, $options, true) solves issues with type conversion (like
foobar¹ == (int)0)
But what about the equivalent for a key search?
array_key_exists ( mixed key, array search ) performs automatic type
conversion evil.
I came up with: count(array_keys($options, $value, true)) === 0