PHP UTF-8 Convert Case

This little function converts UTF8 string into upper,lower and/or title case. It is equal to strtoupper,strtolower and ucwords, only these functions are for ANSI.

function mb_convert($string, $type = "title"){
switch($type){
        case "upper": $type = MB_CASE_UPPER;break;
        case "lower": $type = MB_CASE_LOWER;break;
        case "title": $type = MB_CASE_TITLE;break;
}
return mb_convert_case($string, $type, "UTF-8");
}
©2009-2011 Webarto • web design & development • Tuzla // Sarajevo // Beograd