DaveChild\TextStatistics\Text::upperCase PHP Method

upperCase() public static method

Converts string to upper case. Tries mb_strtoupper and if that fails uses regular strtoupper.
public static upperCase ( string $strText, string $strEncoding = '' ) : string
$strText string Text to be transformed
$strEncoding string Encoding of text
return string
    public static function upperCase($strText, $strEncoding = '')
    {
        if (is_null(self::$blnMbstring)) {
            self::$blnMbstring = extension_loaded('mbstring');
        }
        if (!self::$blnMbstring) {
            $strUpperCaseText = strtoupper($strText);
        } else {
            if ($strEncoding == '') {
                $strUpperCaseText = mb_strtoupper($strText);
            } else {
                $strUpperCaseText = mb_strtoupper($strText, $strEncoding);
            }
        }
        return $strUpperCaseText;
    }