arrays - php table of values -


I have a table of such values:

and I want to declare these values ​​in a php class and then to manipulate them easily.

In your opinion, what is the best way to do this?

You can create an indexed array by country name and then by size number: country_sizes = array ('United States' = & gt array (6, 8, 10, 12, 14, 16, 18), ...)

But to avoid mistakes and to make the code more readable, I would label each type of type then I would be an array indicator before the size size , and then the country:

  $ size = array ('S' = & gt; array (combined Ajy US) '= & Gt; 6,' United Kingdom '= & gt; 28, ...),' M '= & gt; Array ('United States' => 8, 'United Kingdom' => 30, ...), ...);   

This is more difficult to make another way, but seems more natural to me (what's the size in the UK?) Anyway, this is your choice according to your choice Is;)

Comments