title: Decode JSON-String from POST-request in PHP Zend 2
body: <p>I could really need a help.</p>
  
  <p>json_decode returns NULL.</p>
  
  <p>I get the string from the POST:</p>
  
  <pre><code>$arrayOfItems = $request-&gt;getPost()-&gt;get('arrayOfItems'); 
  </code></pre>
  
  <p>The string looks like this:</p>
  
  <pre><code>'[{id: 161, value1: 1, value2: 1},{id: 162, value1: 2, value2: 2},{id: 163, value1: 3, value2: 3}]'
  </code></pre>
  
  <p>And I try to get the ids into an array:</p>
  
  <pre><code>$decodedArray = json_decode($arrayOfItems);
  $ids = array();
  foreach ($decodedArray as $v) {
      $ids[] = $v-&gt;id;
  }
  </code></pre>
  
  <p>But json_decode returns NULL.</p>
  
  <p>Any help is welcome.</p>
  
  <p>Kind regards
  rholtermann</p>