cck dynamic select list in a array I have used the code like this

$ch2 = curl_init("http://openexchangerates.org/api/currencies.json");
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1);

$json2 = curl_exec($ch2);
curl_close($ch2);

$currency = json_decode($json2);

$opts = '';
foreach($currency as $key =&gt; $val)
{
$opts .=$key.'=&gt;'.$val.',';
}

return array($opts);


Here I am getting the combo like this everything in a single line

AED=&gt;United Arab Emirates Dirham,AFN=&gt;Afghan Afghani,ALL=&gt;Albanian Lek,...


What can I do for all the currencies listing 1 by 1 ??
This works for me:

&lt;?php

$ch2 = curl_init("http://openexchangerates.org/api/currencies.json");
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1);

$json2 = curl_exec($ch2);
curl_close($ch2);

$currency = json_decode($json2);

return (array)$currency;