I'm trying to assign $totalPrice
a value from the array below but it is only returning 0, the echo $totalPrice
is in some HTML code, if I use echo $sites[$site][0] it displays the value, but not when assigning it to $totalPrice
?
$totalPrice = 0;
$site = "UM";
$totalPrice = $sites[$site][0];
$sites = array
(
"US" => array (38.78, 11, 5.5),
"UM" => array (44.55, 11, 5.5),
"PS" => array (55.28, 11, 5.5),
"PM" => array (66.55, 11, 5.5)
)
echo $totalPrice;