Thread tabelarische liste aus array problem
(9 answers)
Opened by
Gast
at 2004-05-21 14:19
Zweckmäßig wäre vielleicht ein solches Array:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
my $categories = [ ['Autos', ['Opel', ['Astra', 'Corsa',], ], ], ['Motorräder', ['Kawa', ['xx1',], ], ['Susi', ['600', ['xx1',], ], ], ['Susi', ['750', ['xx1',], ], ], ], ];
Sowas ist aber auch per Hash aufbaubar:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
my $categories = { '001' => { 'title' => 'Autos', 'parent' => '', 'children => ['Opel', ], }, '002' => { 'title' => 'Opel', 'parent' => 'Autos', 'children' => ['Astra', 'Corsa',], }, '003' => { 'title' => 'Astra', 'parent' => 'Opel', 'children' => [], }, '004' => { 'title' => 'Corsa', 'parent' => 'Opel', 'children' => [], }, };
\n\n
<!--EDIT|Dieter|1085151175-->
View full thread tabelarische liste aus array problem
|