Sven Mintel
Mitglied
Mmmh...das verstehe ich jetzt nicht, was du meinst.
Ich sehe bei Mathias' Array:
...und bei meinem Array:
...keine entscheidenden Unterschiede. Falls du die Namen der ArraySchlüssel meinst...benenne sie einfach um.
Ich sehe bei Mathias' Array:
Code:
$inputArray = array(
array( 'ID' => 1, 'parentID' => 0, 'title' => 'Element1' ),
array( 'ID' => 2, 'parentID' => 1, 'title' => 'Element2' ),
array( 'ID' => 3, 'parentID' => 2, 'title' => 'Element3' ),
array( 'ID' => 4, 'parentID' => 2, 'title' => 'Element4' ),
array( 'ID' => 5, 'parentID' => 3, 'title' => 'Element5' ),
array( 'ID' => 6, 'parentID' => 3, 'title' => 'Element6' ),
);
Code:
$items = array(
array( 'ID' => 1, 'pID' => 0, 'title' => 'Drinks' ),
array( 'ID' => 2, 'pID' => 1, 'title' => 'Bier' ),
array( 'ID' => 3, 'pID' => 1, 'title' => 'Wein' ),
array( 'ID' => 4, 'pID' => 1, 'title' => 'Schnaps' ),
array( 'ID' => 6, 'pID' => 2, 'title' => 'Radeberger' ,'href'=>'http://www.radeberger.de'),
array( 'ID' => 7, 'pID' => 2, 'title' => 'Edelstoff' ),
array( 'ID' => 8, 'pID' => 3, 'title' => 'Rotwein' ),
array( 'ID' => 9, 'pID' => 3, 'title' => 'Weisswein' ),
array( 'ID' => 10, 'pID' => 4, 'title' => 'Wodka' ),
array( 'ID' => 11, 'pID' => 4, 'title' => 'Whisky' ),
array( 'ID' => 14, 'pID' => 8, 'title' => 'Bordeaux' ),
array( 'ID' => 16, 'pID' => 9, 'title' => 'Riessling' )
);