📅  最后修改于: 2022-03-11 14:48:35.792000             🧑  作者: Mango
function fizzbuzz($liste) {
foreach($liste as $n) {
if($n%3 == 0 && $n%5 == 0) echo 'fizzbuzz';
elseif($n%3 == 0) echo 'fizz';
elseif($n%5 == 0) echo 'buzz';
else echo $n;
echo "\n";
}
}
fizzbuzz([1, 2, 3, 4, 5, 7, 15, 20]);