📅  最后修改于: 2022-03-11 14:54:50.802000             🧑  作者: Mango
function Factorial($number){
if($number <= 1){
return 1;
}
else{
return $number * Factorial($number - 1);
}
}
$number = 5;
$fact = Factorial($number);
echo "Factorial = $fact"; //output : 120
?>