$sayi = "2,587";
$toplam = 0;
$sayi = explode(",",$sayi)[1];
for ($i=0; $i < strlen($sayi); $i++) {
$toplam += $sayi[$i];
}
echo $toplam;


Kolay gelsin.