PcFreak
10-17-2005, 07:46 PM
I have the following Array
with print_r($output);
Array ( [Peter] => 32 [Bibo] => 4 [Lili] => 2 [Uwe] => 2 [Didi] => 1 [Freak] => 0)
with print_r(array_keys ($output));
Array ( [0] => Peter [1] => Bibo [2] => Lili [3] => Uwe [4] => Didi [5] => Freak)
with print_r(array_values ($output));
Array ( [0] => 32 [1] => 4 [2] => 2 [3] => 2 [4] => 1 [5] => 0)
I would like to have a loop for key and value variables, because i want to output this vars in a table on a html page.
e.g
$key[] = ? // Peter, Bibo, Lili etc.
$value[] = ? // 32, 4 ,2 etc
For a table like this
Key / value
__________
Peter / 32
Bibo / 4
Lili / 2
PcFreak
with print_r($output);
Array ( [Peter] => 32 [Bibo] => 4 [Lili] => 2 [Uwe] => 2 [Didi] => 1 [Freak] => 0)
with print_r(array_keys ($output));
Array ( [0] => Peter [1] => Bibo [2] => Lili [3] => Uwe [4] => Didi [5] => Freak)
with print_r(array_values ($output));
Array ( [0] => 32 [1] => 4 [2] => 2 [3] => 2 [4] => 1 [5] => 0)
I would like to have a loop for key and value variables, because i want to output this vars in a table on a html page.
e.g
$key[] = ? // Peter, Bibo, Lili etc.
$value[] = ? // 32, 4 ,2 etc
For a table like this
Key / value
__________
Peter / 32
Bibo / 4
Lili / 2
PcFreak