function Fibonacci($n){
if($n <= 0) {
return 0;
}elseif($n == 1) {
return 1;
}else{
return Fibonacci($n - 1) + Fibonacci($n - 2);
}
}
echo Fibonacci(5);
转载于:https://www.cnblogs.com/ylq818/p/10718257.html