Ciao a tutti, ho una pagina PHP che genera una JSON


if($_GET['uid']){

$result = mysql_query("SELECT......
}


if($type=="articoli"){
while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
$data['articoli'][] = $row;
}
}



e poi

Header('Content-type: application/json');
echo json_encode($data);
exit;


Tutto OK! L'unico problema è che se la query non ritorna nulla io ho null mentre vorrei avere qualche cosa del tipo: {"articoli":[ ] },

Come posso fare?

Grazie