Log 2012
27/08/2023 2023-08-27 18:25$sum = 0;
while (true) {
$input = readline(“Enter a value for סכום (or ‘q’ to quit): “);
if ($input === ‘q’) {
break;
}
if (is_numeric($input)) {
$sum += $input;
} else {
return “Invalid input. Please enter a numeric value.n”;
}
}
return “The sum is: ” . $sum . “n”;