associative arrays..help!

From: Date: Mon, 21 Jan 2002 18:23:20 +0000
Subject: associative arrays..help!
Groups: php.general 
Request: Send a blank email to php-general+get-81405@lists.php.net to get a copy of this message
Hi, This is a long one so pl bear with me... I have an XML structure as follows: <app_info> <app_id>001</app_id> <app_name>WORD</app_name> <app_info> //SUB APPLICATION <app_id>002</app_id> <app_name>excel</app_name> </app_info> <app_info> <app_id>003</app_id> <app_name>PPt</app_name> </app_info> </app_info> <app_info> <app_id>004</app_id> <app_name>ZIP</app_name> </app_info> Where there are sub elements of main elements... When I print the array contents, they are printed as Array ( [0] => DEMO_XML [1] => XML Output [2] => DEMODemo [3] => DEMO_AUTH [4] => XML Auth ) and so on.... whereas I need to make them as Array( [0] [APP] DEMO XML [SUB_APP] XML OUTPUT How can I achieve this?? any suggestions please.... My for loop reads like this: for($y_aux=0; $y_aux<sizeof($nodes_aux); $y_aux++) { $this->appid[] = $nodes_aux[$y_aux]->content; print "<pre>"; print_r ($this->appid)."<br>"; print "</pre>"; } TIA, sands

« previous php.general (#81405) next »