fork download
  1. <?php
  2.  
  3. $json_str = '{
  4. "numero":"1000",
  5. "log": {
  6. "message": "testing connection to the target URL",
  7. "level": "INFO",
  8. "time": "10:24:05"
  9. },
  10. "responsavel": {
  11. "nome":"Responsavel teste"
  12. }
  13. }';
  14.  
  15. $obj = json_decode($json_str);
  16.  
  17. echo "numero: ".$obj->numero;
  18. echo "Mensagem: ".$obj->log->message. " - ";
  19. echo "NĂ­vel: ".$obj->log->level. "</br>";
  20. echo "NOME: ".$obj->responsavel->nome;
Success #stdin #stdout 0.01s 82880KB
stdin
Standard input is empty
stdout
numero: 1000Mensagem: testing connection to the target URL - Nível: INFO</br>NOME: Responsavel teste