我有一个包含国家代码和国家名称的数组。我需要从数组中呼应一个国家。
我有作为数组键的国家代码:
AG
当我做一个 var_dump
var_dump($country_list);
我收到以下信息:
array(224) { [""]=> string(19) "Select a country..." ["AF"]=> string(11) "Afghanistan" ["AL"]=> string(7) "Albania" ["DZ"]=> string(7) "Algeria" ["AD"]=> string(7) "Andorra" ["AO"]=> string(6) "Angola" ["AI"]=> string(8) "Anguilla" ["AQ"]=> string(10) "Antarctica" ["AG"]=> string(19) "Antigua and Barbuda" ["AR"]=> string(9) "Argentina" ["AM"]=> string(7) "Armenia" ["AW"]=> string(5) "Aruba" ["AU"]=> string(9) "Australia" ["AT"]=> string(7) "Austria" ["AZ"]=> string(10) "Azerbaijan" ["BS"]=> string(7) "Bahamas" ["BH"]=> string(7) "Bahrain" ["BD"]=> string(10) "Bangladesh" ["BB"]=> string(8) "Barbados" ["BY"]=> string(7) "Belarus" ["BE"]=> string(7) "Belgium" ["BZ"]=> string(6) "Belize" ["BJ"]=> string(5) "Benin" ....
如何回显国家代码所在的国家名称:AG
对某些人来说这似乎很简单,但我遇到了困难。