我有这个数组:
$country_list =
array(
"AF" => "Afghanistan",
"AL" => "Albania",
"DZ" => "Algeria",
"AS" => "American Samoa",
"AD" => "Andorra",
"AO" => "Angola",
"AI" => "Anguilla",
"AQ" => "Antarctica",
"AG" => "Antigua and Barbuda",
..........
现在我已经从数据库中获取了密钥,但不知道有多少喜欢:
$key='AL,AO,AG';
或者
$key='AG,AD,AS,AQ,AF';
我想从第一个数组中添加数组的键和值以使新数组如下所示:
$key =
array(
"AL" => "Albania",
"AO" => "Angola",
"AG" => "Antigua and Barbuda");
我该怎么做?