Search
-
Recent Posts
Tags
adwords amazon analytics api apple aws blog chrome chromium cloud Design dropbox ec2 email error facebook firefox google google-apps homebrew ipad javascript jQuery linux lion mac microsoft mysql osx os x paypal php plugin quicksilver raspberry pi scam social spam twitter ubuntu unix video windows woo wordpress
Tag Archives: array_search
array_search case insensitive
PHP’s array_search claims that it suppors a case insensitive search, well, sort of, with this message: If needle is a string, the comparison is done in a case-sensitive manner. user says: for case insensitive array_search you could use: function array_search_i($str,$array){ foreach($array as $key => $value) { if(stristr($str,$value)) return $key; } return false; } stefano says: for searching case insensitive better this: array_search(strtolower($element),array_map(‘strtolower’,$array));