title: PHP: Loop on JSON?
body: <p>i have the following JSON:</p>
  
  <blockquote>
    <p>{"Switches":["Auswahl1","Auswahl2","Auswahl3"],"Check_MK":["Auswahl1","Auswahl2","Auswahl3"],"Testgroup":["Auswahl1","Auswahl2","Auswahl3"],"Printer":["Auswahl1","Auswahl2","Auswahl3"],"CAD":["Auswahl1","Auswahl2","Auswahl3"]}</p>
  </blockquote>
  
  <p>How do i loop each object while using PHP?</p>
  
  <p>My thoughts were the following:</p>
  
  <pre><code>   &lt;?php
  
        $jsonfile = file_get_contents('tags.json');
        echo $jsonfile . "&lt;br&gt;&lt;br&gt;";
        $decode = json_decode($jsonfile);
  
        foreach($decode as $key =&gt; $value) {
          echo $key . $value;
        }
  
      ?&gt;
  </code></pre>
  
  <p>Doesn't work..... Also</p>
  
  <pre><code>echo $decode[1];
  </code></pre>
  
  <p>and</p>
  
  <pre><code>echo $decode[1][1];
  </code></pre>
  
  <p>doesn't work..</p>