下面的代码是 json(a part only) ,我必须将整个货币放入一个组合框中。
{
"AED": "United Arab Emirates Dirham",
"AFN": "Afghan Afghani",
"ALL": "Albanian Lek",
"AMD": "Armenian Dram",
"ANG": "Netherlands Antillean Guilder",
"AOA": "Angolan Kwanza",
"ARS": "Argentine Peso"
}
我已经尝试到这里...
$ch2 = curl_init("http://openexchangerates.org/api/currencies.json");
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1);
// Get the data:
$json2 = curl_exec($ch2);
curl_close($ch2);
$currency->LKR; // Here I can retreive a single line
// Decode JSON response:
$currency = json_decode($json2);
我必须将整个货币放入组合框中。