[PHP] Re: problem with arrays. Please Help!!

2001-09-26 Thread ewunia
Hello, But can you be more specific what I need to do with this function? How to use it in the context? Thanks Pedja <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > function array_search ($needle, $haystack, $strict = FALSE) > > > foreach (array_keys($haystack)

[PHP] Re: problem with arrays. Please Help!!

2001-09-25 Thread Pedja
function array_search ($needle, $haystack, $strict = FALSE) foreach (array_keys($haystack) as $key) { if ($strict) { if ($haystack[$key] === $needle) return $key; } else { if ($haystack[$key] == $needle) return $key; } } return FALSE; } "Ewunia" <[EMAIL PROTECTED]> wrote in message

[PHP] Re: problem with arrays. Please Help!!

2001-09-25 Thread Pedja
mixed array_search (mixed needle, array haystack, bool strict) Searches haystack for needle and returns the key if it is found in the array, FALSE otherwise. If the third parameter strict is set to TRUE then the array_search() will also check the types of the needle in the haystack. function a