Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> smarty i foreach
kajtek2008
post
Post #1





Grupa: Zarejestrowani
Postów: 69
Pomógł: 0
Dołączył: 15.08.2009
Skąd: Nowy Sącz

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


Kod
Array
(
    [0] => Array
        (
            [id] => 1
            [tytul] => Biznes
            [status] => 2
            [meta_desc] =>
            [sub] => Array
                (
                    [0] => Array
                        (
                            [id] => 6
                            [id_kat] => 1
                            [tytul] => Praca
                            [status] => 2
                            [meta_desc] =>
                        )

                )

        )

    [1] => Array
        (
            [id] => 2
            [tytul] => Ekonomia
            [status] => 2
            [meta_desc] =>
        )

    [2] => Array
        (
            [id] => 3
            [tytul] => Internet i komputery
            [status] => 2
            [meta_desc] =>
            [sub] => Array
                (
                    [0] => Array
                        (
                            [id] => 1
                            [id_kat] => 3
                            [tytul] => Programy
                            [status] => 2
                            [meta_desc] =>
                        )

                    [1] => Array
                        (
                            [id] => 2
                            [id_kat] => 3
                            [tytul] => Grafika
                            [status] => 2
                            [meta_desc] =>
                        )

                )

        )

)





Mam problem z wyciągnięciem drzewka


Biznes:
-Praca
Ekonomia:
Internet i komputery:
-Programy
-Grafika


Próbowałem przez foreach w foreach ale dalej wyskakuje ze jest tablica

sub:array
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
kajtek2008
post
Post #2





Grupa: Zarejestrowani
Postów: 69
Pomógł: 0
Dołączył: 15.08.2009
Skąd: Nowy Sącz

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


Omg jaki miałem durny bład
Faktycznie zamiast $element.sub miałem wpisane $element[sub]

Dzięki wielkie 2h nad tym spędziłem (IMG:style_emoticons/default/smile.gif)

Ten post edytował kajtek2008 10.11.2012, 10:54:32
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 5.10.2025 - 07:57