-
-
Save ilyasozkurt/f5698462d4ac4bdf23522bf09f69ff15 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function fibonacci($n){ | |
if($n==0) | |
return 0; | |
else if($n==1) | |
return 1; | |
else | |
return (fibonacci($n-1) + fibonacci($n-2)); | |
} | |
// To print the fibonacci series | |
for ($i = 0; $i < 10; $i++){ | |
echo fibonacci($i)." "; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment