avoid printing the index of the array?
<p>I'm looping through a multidimensional/nest array and I get the following result, however I want to get rid of the "1": index numbers in front of each array.   </p>

<pre><code>{"1":{"adjacencies":[{"nodeTo":"2"},{"nodeTo":"5"}],"data":  {"$color":"#EBB056","$type":"star"},"id":1,"name":"rootWarbler&lt;\/label&gt;"},
"2":{"adjacencies":[{"nodeTo":"4"},{"nodeTo":"3"}],"data":{"$color":"#EBB056","$type":"star"},"id":2,"name":"rootJuniper tree&lt;\/label&gt;"},
"3":{"adjacencies":[null],"data":{"$color":"#EBB056","$type":"star"},"id":3,"name":"rootPuff Bird&lt;\/label&gt;"},
"4":{"adjacencies":[{"nodeTo":"5"},{"nodeTo":"3"}],"data":{"$color":"#EBB056","$type":"star"},"id":4,"name":"rootJackRabbit&lt;\/label&gt;"},
"5":{"adjacencies":[null],"data":{"$color":"#EBB056","$type":"star"},"id":5,"name":"rootMountain Lion&lt;\/label&gt;"},
"6":{"adjacencies":[{"nodeTo":"1"}],"data":{"$color":"#EBB056","$type":"star"},"id":6,"name":"rootBobcat&lt;\/label&gt;"}} 
</code></pre>

<p>here is my while loop</p>

<pre><code>$previd = -1;
 while($row=$result-&gt;FetchRow())
{
$id= (float)$row['n_id']; 
$name = $row['name'];
$color1 = $row['color'];
$type1 = $row['type'];
$to= (float)$row['goingto']; 
$thumb =$row['thumb']; //image path


if ($previd != $id) {
    $previd = $id; 
    if ($previd != -1) {
        array_push($array,$node);
    }

    $node[$id] = array(
        "adjacencies" =&gt; array(),
        "data" =&gt; array(
                "$"."color" =&gt; $color1,
                "$"."type" =&gt; $type1 
            ),
        "id" =&gt; $id,
        "name" =&gt; "&lt;img src='".$thumb."' height='25' width='25' alt='root'/&gt;&lt;label&gt;".$name."&lt;/label&gt;");
}


if ($to != null) { 
    $node[$id]["adjacencies"][]=array("nodeTo" =&gt; "$to");
}


}
print_r($node);
</code></pre>
