title: Convert JSON list to php array
body: <p>I am passing a list of numbers from a page to PHP serialized in JSON</p>
  
  <pre><code>{"items":"[1,2,3,4]"}
  </code></pre>
  
  <p>in my URL it is just</p>
  
  <pre><code>...&amp;items={"items":[1,2,3,4]}
  </code></pre>
  
  <p>I decode this in PHP</p>
  
  <pre><code>$json = $_GET["items"];
  $arr = json_decode($json, true);
  </code></pre>
  
  <p>I get an array</p>
  
  <pre><code>Array ( [items] =&gt; [1,2,4] )
  </code></pre>
  
  <p>But when I try a <code>foreach</code> on <code>arr["items"]</code> and print out each value, all I get is a single value</p>
  
  <pre><code>[1,2,4]
  </code></pre>
  
  <p>This is the code I am using to iterate</p>
  
  <pre><code>foreach($res["items"] as $value)
      echo $value; 
  </code></pre>
  
  <p>How come I am not getting something like</p>
  
  <pre><code>1
  2
  4
  </code></pre>