Pages

Wednesday, March 5, 2014

How to Parse JSON in php

<?php
   $json ='{"id":1,"name":"foo","interest":["wordpress","php"]} ';

   $obj=json_decode($json);

   echo $obj->interest[1]; //prints php
?>

No comments:

Post a Comment