title: Is there a good way to unserialize individual array elements in PHP?
body: <p>Is there a way to use PHP to unserialize individual array members?</p>
  
  <p>Example - array of serialized objects</p>
  
  <pre><code>//$array
  Array
  (
      [0] =&gt; O:21:"Calc\Calc":22:{s:3:"qok";...
      [1] =&gt; O:21:"Calc\Calc":22:{s:3:"qok";...
      [2] =&gt; O:21:"Calc\Calc":22:{s:3:"qok";...
  )
  </code></pre>
  
  <p>What I want is to transform it into an array of objects.   For example, say I want to </p>
  
  <ol>
  <li>unserialize them like I want</li>
  <li>convert result into JSON</li>
  </ol>
  
  <p>Is there was perhaps a way to do it like so:</p>
  
  <pre><code>$resultingJSON = '[' . implode(',', MAGIC_UNSERIALIZE_EACH($selections)). ']';
  </code></pre>