I have an array that stores names of countries (keys) and age expectancy (values).
$countries = array(
'Costa Rica' => 78, 'Puerto Rico' => 78, 'Colombia' => 73,
'Nicaragua' => 73, 'El Salvador' => 72, 'Peru' => 71,
'Argentina' => 75, 'Uruguay' => 76, 'Ecuador' => 75,
'Mexico' => 76, 'Venezuela' => 73, 'Brasil' => 72,
);
An html form creates a new variable ($country) with a name that corresponds to one countries listed above.
For example: "Costa Rica"
How can I return a variable with the number (age expectancy) that matches the name of the country in the $country variable?
Take for example:
Costa Rica = 78
$ageExpectancy = 78;
Thanks, I hope to be concise.