Hey guys im trying to run through an array of checkboxes to add up a price and keep getting an unexpected } error and i cant figure out why:
$price;
foreach($_POST['extras'] as $extra)
{
if($extra == "Deodoriser"){
$price = $price + 10;
} elseif($extra == "Carpet Protector (5 litre)"){
$price = $price + 20
} elseif($extra == "Carpet Repair Tools"){
$price = $price + 30
} elseif($extra == "Furniture Moving Equipment"){
$price = $price + 40
} elseif($extra == "Furniture Tabs"){
$price = $price + 50
} elseif($extra == "Urine Decontamination Treatment"){
$price = $price + 60 }
}
I now get this error
Parse error: syntax error, unexpected T_FOREACH in /home/fevsdiet/public_html/diycarpetcare.co.uk/booking/booking.event.processing.php on line 45
Alternative: