0
I have an api that returns me an array in JSON, as follows:
[{"Pessoa_contato":"EUZEBIO"}]
But I’m not getting back without these brackets, as my application needs:
{"Pessoa_contato":"EUZEBIO"}
This is the script of this return:
try {
if (class_exists($classe)) {
if (method_exists($classe, $metodo)) {
$retorno = call_user_func_array(array(new $classe, $metodo),
$parametros);
return json_encode(array( $retorno));
} else {
return json_encode(array('Método inexistente!'));
}
} else {
return json_encode(array('Classe inexistente!'));
}
}
only do so in return
return json_encode($retorno);
I think that’s it, I have no more information so it’s in the chutometro– novic