ciao a tutti, ho una pagina che genera un XML


//Begin of the Document Creation
$XML = new SimpleXMLElement("<locations></locations>");

while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {

$aaa = $XML->addChild('location');
$aaa->addChild('id', $row{'id'});


Tutto OK, ma vorrei fare una prova generando un JSON invece che un XML, cosa devo cambiare ??

Thanks