Began to get acquainted with Json, code:

<?php $json_string='{"id":1,"name":"ivan","country":"Russia","office":["yandex"," management"]} '; $obj=json_decode($json_string); echo $obj->name; echo $obj->office[0]; ?> 

Displays:

 name; echo $obj->office[0]; ?> 

I can not understand why

  • My code is working properly, you have PHP configured correctly? - cheops
  • It was standardly supplied with Endels, before that there were no complaints - DaVASrK
  • the interpreter does not work for you, the script is given a text file to the outside. The entire part from the first opening angle bracket to the first closing browser counts as a tag. - etki
  • Thank you, the issue is resolved, after a couple of restarts of the local server, everything worked - DaVASrK
  • If possible, publish the solution found in response to your question . I am sure it will help many of your colleagues in the future. - Nicolas Chabanovsky

0