I'm trying to assign country code as key, country name as value. The following is my code, if any wrong please correct me.
$return = array();
foreach($result as $key=>$value){
array_splice($return, count($return),0, array($value['country_code']=>$value["name"]));
}