function convert_weight($gram){
$arr = array(
'ounce' => 0.035274,
'drachma' => 0.564382,
'pounds' => 0.00220462,
);
return array_map(function ($item) use ($gram){
return round($gram * $item, 4);
}, $arr);
}
print_r(convert_weight(15));
Array
(
[ounce] => 0.5291
[drachma] => 8.4657
[pounds] => 0.0331
)