Signatur
mb_convert_encoding(array|string $string, string $to_encoding, array|string|null $from_encoding = null): array|string|false
Beschreibung
Wichtig bei CSV-Import von Excel-Files oder Legacy-Datenbanken.
Parameter
| Name | Typ | Default | Beschreibung |
|---|---|---|---|
| $string Pflicht | string|array | — | Eingabe. |
| $to_encoding Pflicht | string | — | Ziel-Encoding. |
| $from_encoding | string|array|null | null | Quell-Encoding. |
Rückgabewert
Typ
string|false
Beschreibung
Konvertiert.
Beispiele
Windows → UTF-8
<?php
$utf8 = mb_convert_encoding($legacy, 'UTF-8', 'Windows-1252');