all'inizio dichiara:

$totale=floatval(0)

$totale+=floatval($valore);