Jump to content

Get data from this array...


Crimpage

Recommended Posts

Hi Everyone,

 

I have data in an array that looks like this:

 

Array
(
    [Adelaide] => Array
        (
            [Agriculture] => Array
                (
                    [CHAT. MTGE] => Array
                        (
                            [amtfinanced] => VALUE
                            [numberofdeals] => VALUE
                            [brokerage] => VALUE
                            [docfee] => VALUE
                        )

                )

            [Transport & Storage] => Array
                (
                    [CHAT. MTGE] => Array
                        (
                            [amtfinanced] => VALUE
                            [numberofdeals] => VALUE
                            [brokerage] => VALUE
                            [docfee] => VALUE
                        )

                )

            [Agriculture,Forest & Fishing] => Array
                (
                    [LEASE] => Array
                        (
                            [amtfinanced] => VALUE
                            [numberofdeals] => VALUE
                            [brokerage] => VALUE
                            [docfee] => VALUE
                        )

                    [CHAT. MTGE] => Array
                        (
                            [amtfinanced] => VALUE
                            [numberofdeals] => VALUE
                            [brokerage] => VALUE
                            [docfee] => VALUE
                        )

                )
        )
)

 

And what I need to do, is get the values of the Office Name (Brisbane), Industry (Agriculture), Product(Chat. MTGE), then the values for amt finance, num deals, brokerage, docfee...

The info is a report grouped by office, industry then product and I basically just need to get it into Excel. You can see there is a main array (Office), then under that it has an array for each industry, then an array for each product, then the total values will be in there. I also need to get the array key values as these are dynamic and will change.

 

Any ideas would be great. The structure of the array won't change.

 

Cheers,

Dave.

Link to comment
Share on other sites

maybe you only need to specify the index where you will get that data

 

like $x[brisbane][Agriculture][CHAT. MTGE] not to get all the value

foreach($x[brisbane][Agriculture][CHAT. MTGE] as $xy)

echo $xy[amtfinanced];

Link to comment
Share on other sites

Hi,

 

Thanks for the quick reply. I also need to get the array key values as these are dynamic.

 

Basically for each row in Excel I will need:

 

Office - Industry - Product - AmtFinanced - NumberofDeals - Brokerage - DocFee

 

Which should look like:

 

Adelaide - Agriculture - Chat. MTGE - $5,000 - 1 - $200 - $50

Adelaide - Agriculture - HP              - $10,000 - 2 - $500 - $200

 

and so on...

 

Cheers,

Dave.

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.