Jump to content

Help with array *SOLVED*


Pythondesigns

Recommended Posts

Hey,

I have an array like this which is called $CFG.

[quote]Array
(
    [online] => 1
    [sitename] => MySite
    [indexurl] => http://mysite.com
    [areas] => Array
        (
            [home] => Array
                (
                    [id] => 1
                    [text] => Home
                    [order] => 0
                    [navshow] => 1
                )

            [profile] => Array
                (
                    [id] => 2
                    [text] => Profile
                    [order] => 1
                    [navshow] => 1
                )

            [jobs] => Array
                (
                    [id] => 3
                    [text] => Jobs
                    [order] => 3
                    [navshow] => 1
                )

            [business] => Array
                (
                    [id] => 4
                    [text] => Business
                    [order] => 4
                    [navshow] => 1
                )

            [finance] => Array
                (
                    [id] => 5
                    [text] => Finance
                    [order] => 5
                    [navshow] => 1
                )

        )

)[/quote]

As you can see the $CFG[areas] is another array. And then within each again is an array.

Basically each of the values inside the $CFG[areas] are links for a menu Im making and what I want to do is to cycle through them all (theres 5 of them) and display its relevant id.

So at the end I want this...

[quote]Home (which links to homes id)
Profile (which links to profiles id)
Jobs (which links to jobs id)
And so on...[/quote]

How can I do this?

Thanks
Link to comment
https://forums.phpfreaks.com/topic/22163-help-with-array-solved/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.