<?php
function hesap($sayi){
if(!is_array($sayi)) return false;
$toplam = 0;
foreach($sayi as $say){
// noktaları yoket
$say = str_replace(".","",$say);
// virgülleri noktaya çevir ve double tipine typecast et
$say = (double)str_replace(",",".",$say);
$toplam += $say;
}
return number_format($toplam, 2, ',', '.');
}
echo hesap([
"1.281,66",
"1.301,20",
"1.199,30"
]);
Evet bu çok iyi oldu. Emeğine sağlık onurkun.