Hi,
I have a problem with an array and a function. The problem is that the function does not give the expected result. Here's some example code:
$fruit = "bananas";
$prices = array(
"apples" => "11.00",
"bananas" => "8.00",
"oranges" => "10.00"
);
function getprice($fruit){
echo $prices["$fruit"];
}
getprice($fruit);
?>
I would expect this to print out "8.00", but it doesn't print out anything. How come?