I have a PHP
application that returns me a string
Json
:
$cep = $_POST['cep'];
$token = '';
$url = 'http://www.cepaberto.com/api/v2/ceps.json?cep=' . $cep;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Token token="' . $token . '"'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
echo $output;
I would like to know how to get the value of the string that is returned
{"altitude":14.3,"bairro":"Santa Inês","cep":"68901487","latitude":"0.0355735","longitude":"-51.070535","logradouro":"Passarela Acelino de Leão","cidade":"Macapá","ddd":96,"ibge":"1600303","estado":"AP"}