Thread: Compare Content in Multidimensional Array [PHP/SQL]
Hi there,
I have some global national statistical data sets.
The table design is like this for each variable:
name 2001 2002 2003 2004 2005
-----------------------------------------------------------------
Afghanistan ....
Albania ....
I would like to offer the possibility to compare two (or more) variables for a given country. The data values need to be set to 100 at the first year which both variables have in common.
So, one variable could have an annual vallues between 1960 and 2005; another one only from 1975 to 2005.
So, the values for the country would be set to 100 based on the year 1975.
In the moment I have a loop for the number of variables, selecting all data and stocking them into an array:
$data[$number_of_dataset][$year] = $value_of_that_year;
Probably there could be better approach in finding the "smallest_common_year"?!
If not, I wonder how, by using PHP, I can get that information...
Can anyone give me a hint?
Thank you very much!
Stef
____________________________________________________________________
Stefan Schwarzer
Lean Back and Relax - Enjoy some Nature Photography: http://photoblog.la-famille-schwarzer.de
Or: Appetite for Global Data? UNEP GEO Data Portal: http://geodata.grid.unep.ch
____________________________________________________________________