Insert values in an associative array but only if have value
<p>I've this bucle:</p>

<pre><code>foreach($jsonU as $j) {
        $jsonUId = $j-&gt;id;
        $jsonUName = $j-&gt;name;
        $jsonUDescription = $j-&gt;description;
        $jsonUDate = $j-&gt;date;
        $jsonUStatus = $j-&gt;status;
        $jsonUPicture = $j-&gt;picture;

        $jsonUncompleted[] = array('id'=&gt; $jsonUId, 'name'=&gt; $jsonUName, 'description' =&gt; $jsonUDescription, 'date' =&gt; $jsonUDate, 'status' =&gt; $jsonUStatus, 'picture' =&gt;$jsonUPicture);
}  
</code></pre>

<p>I need to insert a key in the array only if have value. For example, <code>$jsonUPictore</code> not always has a value and in that case I don't need to write that key.</p>

<p>Some help?</p>
