Grow your CSS skills. Land your dream job.

Last updated on:

Parse JSON

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

   $obj=json_decode($json);

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

Comments

  1. Nice code……..

    It works. I’ve used it for search suggestion using Yahoo UI.

  2. Mark
    Permalink to comment#

    So simple. Exactly the little snippet I needed.

  3. Perfect. Thanks.

Leave a Comment

Current day month ye@r *

*May or may not contain any actual "CSS" or "Tricks".