Autor Beitrag
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Do 30.03.06 14:26 
Tach.

Ich hab ein Array, das wie folgt aussieht:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
Array
(
    [eins] => Array
        (
            [name_eins] => value_eins
        )

    [zwei] => Array
        (
            [name_zwei] => value_zwei
        )

)


Und möchte jetzt, dass ich per foreach das so ausgeben kann, dass das (mit dem Beispiel oben) so aussieht:
ausblenden Quelltext
1:
2:
eins | name_eins | value_eins
zwei | name_zwei | value_zwei


Das klappt bei mir nur teilweise. Kann mir mal jemand seine Lösung dafür zeigen?

Danke, coucou,
WeBBy

_________________
Steht der Bauer im Gemüse, hat er später grüne Füße.
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: Do 30.03.06 14:33 
Wie sieht denn dein Quelltext aus? Bei mir geht das wunderbar:

ausblenden foreach.php
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
<html>
<body>
<?php

  $arr = Array( "eins" => Array( "name_eins" => "value_eins"),
                "zwei" => Array( "name_zwei" => "value_zwei"));

  print_r($arr);
  echo "<br/><br/>";
  foreach($arr as $key_eins => $val_eins)
  {
    echo "$key_eins | ";
    foreach($val_eins as $key_zwei => $val_zwei)
    {
      echo "$key_zwei | $val_zwei";
    }
    echo "<br/>";
  }
?>
</body>
</html>



Gruß,
raziel

_________________
JSXGraph
WeBsPaCe Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Mi 05.04.06 11:47 
Mh. Hatte ich eigentlich auch so. Jetzt geht's auf jeden Fall. Danke! :lol:

coucou,
WeBBy

_________________
Steht der Bauer im Gemüse, hat er später grüne Füße.