fetching from DB and store them in a new array PHP
<p>I am fetching data from my DB and they look like this:</p>

<pre><code>[{"0":"1","key-1":"1","1":"1","key-2":"1","2":"1","key-3":"1","3":"1","key-4":"1"}] 
</code></pre>

<p>where the key-1 are the name of the column. (I only have one entry so).</p>

<p>I want to extract only the column values and save them into a new array that will output like this:</p>

<pre><code>{"key-1":"1","key-2":"1","key-3":"1","key-4":"1"} 
</code></pre>

<p>I want it to look exactly like this and not :  <code>[{"key-1":"1","key-2":"1","key-3":"1","key-4":"1"}]</code> </p>

<p>I tried this:</p>

<pre><code>$cart["key-1"]=$output["key-1"];
</code></pre>

<p>where $output is the outcome of the DB that shown first (the one with []).</p>

<p>and the $cart is the new array I want.</p>

<p>Both are declared as:</p>

<pre><code>$cart=array();
$output=array();
</code></pre>

<p>and <code>$output[]=$row</code> where row is the result of the DB fetch. How to do it?</p>
