title: improving loop throw a schema on php
body: <p>This is working, but feels really "dirty"</p>
  
  <p>I have a schema json like:</p>
  
  <pre><code>[
    {
      "url": "http://www.google.com/api/updateVariable",
      "verb": "POST",
      "bodySchema": {
        "type": "object",
        "properties": {
          "StoreId": {
            "sync": "True",
            "type": "integer"
          },
          "SKU": {
            "sync": "True",
            "type": "string"
          },
          "WareHouseId": {
            "sync": "False",
            "type": "integer"
          },
          "Stock": {
            "sync": "True",
            "type": "integer"
          }
        },
        "required": [
          "StoreId",
          "SKU",
          "Stock"
        ]
      }
    },
  
    {
      "url": "http://www.google.com/api/insertVariable",
      "verb": "POST",
      "bodySchema": {
        "type": "object",
        "properties": {
          "StoreId": {
            "sync": "True",
            "type": "integer"
          },
          "SKU": {
            "sync": "True",
            "type": "string"
          },
          "WareHouseId": {
            "sync": "False",
            "type": "integer"
          },
          "Description": {
            "sync": "True",
            "type": "integer"
          }
        },
        "required": [
          "StoreId",
          "SKU",
          "Description"
        ]
      }
    }
  ]
  </code></pre>
  
  <p>And I want to loop throw all the properties (once again, this is working)</p>
  
  <pre><code>    $result=json_decode($result, true);
      while($item = array_shift($result)){
          foreach ($item as $key =&gt; $value){
              if($key=="bodySchema"){
                  foreach ($value as $key2 =&gt; $value3){
                      if($key2==properties)
                          var_dump($value3);
                  }
              }
          }
      }
  </code></pre>
  
  <p>What I would like to have is something like:</p>
  
  <pre><code>$result=json_decode($result, true);
  foreach($result as $mydata){
       foreach($mydata-&gt;bodySchema-&gt;properties as $values){
            var_dump($values-&gt;value);
       }
  }
  </code></pre>
  
  <p>is this possible?, I want to keep this code as clean and neat as possible</p>