I've this bucle:
foreach($jsonU as $j) {
$jsonUId = $j->id;
$jsonUName = $j->name;
$jsonUDescription = $j->description;
$jsonUDate = $j->date;
$jsonUStatus = $j->status;
$jsonUPicture = $j->picture;
$jsonUncompleted[] = array('id'=> $jsonUId, 'name'=> $jsonUName, 'description' => $jsonUDescription, 'date' => $jsonUDate, 'status' => $jsonUStatus, 'picture' =>$jsonUPicture);
}
I need to insert a key in the array only if have value. For example, $jsonUPictore
not always has a value and in that case I don't need to write that key.
Some help?