A simple multibyte-safe case-insensitive string comparison:
<?php
function mb_strcasecmp($str1, $str2, $encoding = null) {
if (null === $encoding) { $encoding = mb_internal_encoding(); }
return strcmp(mb_strtoupper($str1, $encoding), mb_strtoupper($str2, $encoding));
}
?>
Caveat: watch out for edge cases like "ß".