Guarda, il mio codice è questo, che a seconda se ho php5 o no mi fa partire la libreria o il file
codice:
function JEncode($arr){
if (version_compare(PHP_VERSION,"5.2","<"))
{
require_once("./JSON.php"); //if php<5.2 need JSON class
$json = new Services_JSON(); //instantiate new json object
$data=$json->encode($arr); //encode the data in json format
} else
{
$data = json_encode($arr); //encode the data in json format
}
return $data;
}
Mentre il file Json.php è il package Services_JSON versione 1.30
L'errore me lo dà solo per caratteri speciali, come accenti. Altrimenti funziona correttamente