public static function ucfirst($str)
    {
        switch (AnHelperString::strlen($str)) {
            case 0:
                return '';
            break;
            case 1:
                return AnHelperString::strtoupper($str);
            break;
            default:
                preg_match('/^(.{1})(.*)$/us', $str, $matches);
                return AnHelperString::strtoupper($matches[1]).$matches[2];
            break;
        }
    }
public static function ucfirst($str)
    {
        switch (AnHelperString::strlen($str)) {
            case 0:
                return '';
            break;
            case 1:
                return AnHelperString::strtoupper($str);
            break;
            default:
                preg_match('/^(.{1})(.*)$/us', $str, $matches);
                return AnHelperString::strtoupper($matches[1]).$matches[2];
            break;
        }
    }
public static function ucfirst ( $ str ) { switch ( AnHelperString :: strlen ( $ str ) ) { case 0 : return '' ; break ; case 1 : return AnHelperString :: strtoupper ( $ str ) ; break ; default : preg_match ( '/^(.{1})(.*)$/us' , $ str , $ matches ) ; return AnHelperString :: strtoupper ( $ matches [ 1 ] ) . $ matches [ 2 ] ; break ; } }
UTF-8 aware alternative to ucfirst

Make a string's first character uppercase

@param string
@return string with first character as upper case (if applicable)
@see http://www.php.net/ucfirst
UTF - 8 aware alternative to ucfirst