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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.