I'm trying to make an application to get cnpj data in the federal revenue api. I can get and print all data via json, my problem is that I would like to print just a specific data, which in the case would be the email field, how can I do that?
Follow the api documentation link link
header("Content-Type: text/plain");
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.receitaws.com.br/v1/cnpj/" . $linha['cnpj']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$retorno = curl_exec($ch);
curl_close($ch);
$retorno = json_decode($retorno); //Ajuda a ser lido mais rapidamente
echo json_encode($retorno, JSON_PRETTY_PRINT);