Toolbox::decodeFromUtf8 PHP Méthode

decodeFromUtf8() static public méthode

Decode string from UTF-8 to specified charset
static public decodeFromUtf8 ( $string, $to_charset = "ISO-8859-1" ) : converted
$string string string to convert
$to_charset string destination charset (default "ISO-8859-1")
Résultat converted string
    static function decodeFromUtf8($string, $to_charset = "ISO-8859-1")
    {
        return mb_convert_encoding($string, $to_charset, "UTF-8");
    }

Usage Example

Exemple #1
0
function decodeFromUtf8Array(&$arg)
{
    if (is_array($arg)) {
        foreach (array_keys($arg) as $key) {
            decodeFromUtf8Array($arg[$key]);
        }
    } else {
        if (is_string($arg)) {
            $arg = Toolbox::decodeFromUtf8($arg);
        }
    }
}
All Usage Examples Of Toolbox::decodeFromUtf8