Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Wyświetlanie tablicy
aceide
post
Post #1





Grupa: Zarejestrowani
Postów: 65
Pomógł: 0
Dołączył: 13.05.2004
Skąd: Uć.

Ostrzeżenie: (0%)
-----


Mam tablicę:

  1. <?php
  2. $array = array(
  3.  
  4. &#092;"server\" => array(
  5.         &#092;"quota\" => array(\"element1\",\"element2\",\"element3\",\"element4\"),
  6.         &#092;"band\" => array(\"element5\",\"element6\",\"element7\",\"element8\")
  7.                    )
  8.         
  9. );
  10. ?>

... i chcę, aby za pomocą pętli wyświetlało mi zawartość całego $array["server"]. w postaci (na podstawie w/w przykładu):

element1,element2,element3,element4 <BR>
element5,element6,element7,element8 <BR>

Nie bardzo wiem jak to wyjaśnić.

Robiłem w ten sposób, ale nie działa:

  1. <?php
  2. while ($category = each ($array[&#092;"server\"]) )
  3. {
  4. echo $array[&#092;"server\"][$category][1].$array[\"server\"][$category][2].$array[\"server\"][$category][3].$array[\"server\"][$category][4];                
  5. }
  6. ?>


Help smile.gif

Ten post edytował aceide 15.07.2005, 15:34:52
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 20.08.2025 - 10:12