Question: Here when I click on `No` the text box should get hidden but it is not happening. When I put the same `div` inside the `td` from where I am calling the `onclick` event it is working.

```
<!DOCTYPE html>
<html>
    <head>
    <script>   
        src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js">   
    </script>
    <script>
        $(document).ready(function(){
            $("#btn1").click(function(){
                $("#data").show();
            });
            $("#btn2").click(function(){
                $("#data").hide();
            });
        });
    </script>
</head>

<table>
    <tr>
        <th>Table</th>
        <td>
            <input type="radio" id="btn1" name="gate" value="N" checked>Yes</input>
            <input type="radio" id="btn2" name="gate" value="E" >No</input>  
        </td>
    </tr>

    <div id="data" style="padding-top: 10px">
        <tr>
            <th>GATE</th>
            <td><input type="text" name="gate1" value=gate1 size="20"></td>
        </tr>
    </div>
</table> 
</html>

```

Answer: 
If you want only the parts

```
foreach ($item{"parts"] as $key => $value)
{
    echo $key.' => '.$value."\n";
}

```

Sample here: [http://sandbox.onlinephpfunctions.com](http://sandbox.onlinephpfunctions.com/code/6ab9a0592ca9a8f735fdc326c82ced39755ad16c)
If you want every 2 level property:

```
$items=json_decode($json,true);
foreach ($items as  $item) {

    foreach ($item as $key => $value)
    {
       if( is_array($value) ) { 

          foreach ($value as $subkey => $part)
          {
              foreach ($part as $partkey => $partvalue)
              {
                  echo $key .' '. $subkey . ' ['.$partkey.'] => '.$partvalue."\n";
              }
          }
       } else {

        echo $key.' => '.$value."\n";
       }
    }

}

```
Maybe you can use `$array_json = json_decode($json_var, true)` and then `$parts = $array_json["parts"];` (I haven't execute the code, maybe has some errors)

<http://php.net/manual/en/function.json-decode.php>