PHP: JSON e la codifica UTF-8

PHP: JSON e la codifica UTF-8

PHP richiede che i dati JSON siano codificati in UTFf-8 per poter essere interpretati.

La soluzione รจ la seguente:


$json_file = file_get_contents('file.json');
$json_data = utf8_encode($json_file);
$json_obj = json_decode($json_data);

Torna su