title: how to parsing value of json file with php class
body: <p>i try to parsing json with format like this</p>
  
  <pre><code>{
    "bossresponse":{
      "responsecode":"200",
      "web":{
        "start":"0",
        "count":"50",
        "totalresults":"88300000",
        "results":[
          {
            "date":"",
            "clickurl":"http:\/\/naruto.viz.com\/",
            "url":"http:\/\/naruto.viz.com\/",
            "dispurl":"naruto&lt;\/b&gt;.viz.com",
            "title":"NARUTO&lt;\/b&gt; Shippuden - OFFICIAL U.S. Site - Watch the Anime ...",
            "abstract":"Check out the latest discussions! TOPICS. AUTHOR"
          },
          {
            "date":"",
            "clickurl":"http:\/\/naruto.com\/",
            "url":"http:\/\/naruto.com\/",
            "dispurl":"naruto&lt;\/b&gt;.com",
            "title":"NARUTO&lt;\/b&gt;",
            "abstract":""
          }
        ]
      }
    }
  }
  </code></pre>
  
  <p>and when i parse with this function </p>
  
  <pre><code>$json = file_get_contents("test.json");
  $jsonIterator = new RecursiveIteratorIterator(
                          new RecursiveArrayIterator(json_decode($json, TRUE)),
                          RecursiveIteratorIterator::SELF_FIRST);
  foreach ($jsonIterator as $key =&gt; $val) {
              if (is_array($val)) {
                  //echo "$key:\n";
                  if($key == "web"){
                      foreach($val as $key1 =&gt; $results){
                          if(is_array($results)){
                              if($key1 == "results"){
                                  foreach($results as $key2 =&gt; $v){
                                      if (is_array($v)) {
                                          foreach ($v as $v1) {
                                             echo $v[title];
  
                                          }
                                      }
                                  }
                                  //echo $results;
                              }
  
                          }
  
                      }
                      //echo $val;
                  }
              } else {
                  //echo "$key =&gt; $val\n";
              }
          }
  </code></pre>
  
  <p>it's successfull but i think my code is crazy code,you can look foreach and foreach very much is not good to maintenance. i want to implement in OOP like with class...
  can you help me how i can do that?any suggestion?</p>