Jump to content

[SOLVED] Retreive sub-arrays in a multidimensional array. Need help.


romain.pelissier

Recommended Posts

Hi,

I am stuck with what it seems to me a simple problem and I need some help. I am very new php programmer ... I am pretty sure that you experts can give me the answer in few words..

Here it is :

 

I have a multidimensional array that looks like this :

Array ( [2007] => Array ( [0] => Array ( [mois] => 7 [path] => /var/www/html/rapports/ARCHIVES/2007/7 ) [1] => Array ( [mois] => 6 [path] => /var/www/html/rapports/ARCHIVES/2007/6 ) ) [2006] => Array ( [0] => Array ( [mois] => 1 [path] => /var/www/html/rapports/ARCHIVES/2006/1 ) ) )

 

As you can see, the indexes are a number : 2007, 2006, ... and each item of those keys contains an array with other items like a path and a number :

2007
       0
           path : /var/www/html/rapports/ARCHIVES/2007/
           month : 7
       1
           path : /var/www/html/rapports/ARCHIVES/2007/
           month : 6
2006
       0
...

 

Now, if I know my index number (let say 2007) is there a way to retrieve the entire sub-array for that particular key so I can have in  a array the values for the key I have choosed ?

 

I hope you could answer me.

 

Thanks

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.