$string = "&%sTr=+jv=/DnHX491713QfJIJEJetT&i^r58402CdzSk=wHQhf%k172854ae &JNBkSV&P%";
preg_match_all('!\d+!', $string, $rakamlar);

$toplam = 0;

foreach($rakamlar[0] as $rakam) {
$toplam += intval($rakam);
}

echo $toplam;
?>