note 44817 deleted from function.in-array by felipe

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
Note Submitter: mina86 at tlen dot pl 

----

A better (faster) version:
<?php
function in_array ($item, $array) {
    $item = &strtoupper($item);
    foreach($array as $element) {
        if ($item == strtoupper($element)) {
            return true;
        }
    }
    return false;
}
?> 

Noah B, set the 3rd argument to true and everything will wokr fine :) 0 == 'foo' is true, however 0 === 'foo' is not.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.