1
I have the URL of an API that generates a JSON. I have this code below, however I need separate fields for me to be able to create while of the items and to separate type echo $row['nome_marca']
and etc. Some light?
<?php
header("Content-Type: application/json");
$jsonData = file_get_contents("http://www.folhacar.com.br/frontendnovo.php/api/listMarcas");
echo $jsonData;
?>
From what I understand you want to decode JSON. You need this in PHP itself, or it would be at the other end, in Javascript?
– bfavaretto
have you tried using php’s json_decode function? This would give you an array - http://php.net/json_decode
– Gildonei
I haven’t tried yet because I don’t have much intimacy with php, but I need to resolve this. Could you give me an example of how I can individually use this array after the implementation?
– Fábio Duarte