Parse JSON Data


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $json_string='{"id":1,"name":"foo","email":"[email protected]","interest":["wordpress","php"]} ';
  2. $obj=json_decode($json_string);
  3. echo $obj->name; //prints foo
  4. echo $obj->interest[1]; //prints php

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.