Da testare:
Codice PHP:
$data = json_decode($json, true);
foreach ($data['attivita'] as &$attivita) {
foreach ($attività as &$valore) {
$valore = is_array($valore) ? $valore : [$valore];
}
}
print(json_encode($data, JSON_PRETTY_PRINT));
Da testare:
Codice PHP:
$data = json_decode($json, true);
foreach ($data['attivita'] as &$attivita) {
foreach ($attività as &$valore) {
$valore = is_array($valore) ? $valore : [$valore];
}
}
print(json_encode($data, JSON_PRETTY_PRINT));