How can I display the values of a JSON via echo in PHP, I am using the code below to receive JSON from the Post Office site
$json_file = file_get_contents("http://cep.correiocontrol.com.br/$cep.json");This JSON has the following values:
$json_str = json_decode($json_file, true); //echo "$json_str";
{"bairro": "Jangurussu", "logradouro": "Rua 22", "cep": "60876470", "uf": "CE", "localidade": "Fortaleza"}Is there any way I can use echo to display these values? Home Ex.
echo "Bairro: $bairro"; echo "Logradouro: $logradouro"; echo "CEP: $cep"; echo "UF: $uf"; echo "Localidade: $localidade";Result: Home Neighborhood: Jangurussu Home Street: Street 22 Home CEP: 60876470 Home UF: CE Home Location: Fortaleza