Skip to content

Instantly share code, notes, and snippets.

@Jul10l1r4
Created December 15, 2017 15:39
Show Gist options
  • Save Jul10l1r4/47284582166f95fa2b6bc05fc77263cf to your computer and use it in GitHub Desktop.
Save Jul10l1r4/47284582166f95fa2b6bc05fc77263cf to your computer and use it in GitHub Desktop.
Pegando dados json created by Jul10l1r4 - https://repl.it/@Jul10l1r4/Pegando-dados-json
<?php
$url = file_get_contents( "http://dados.ufrn.br/api/action/datastore_search?resource_id=ff0a457e-76fa-4aca-ad99-48aebd7db070&limit=1" );
// Aqui vai ser o linnk do json que irão mandar
$users = json_decode ( $url, true );
// essa variavel $users irá pegar o json e transforma-la em array
$OqueEuQueroDoJson = "nome";
print_r($users["result"]["records"][0][$OqueEuQueroDoJson]);
//print_r no caso faz com que ele exiba array.. e assim fica mais facil pra vc pegar alguma informação
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment