Skip to content

Instantly share code, notes, and snippets.

@ilyasozkurt
Last active February 19, 2023 14:56
Show Gist options
  • Save ilyasozkurt/f5698462d4ac4bdf23522bf09f69ff15 to your computer and use it in GitHub Desktop.
Save ilyasozkurt/f5698462d4ac4bdf23522bf09f69ff15 to your computer and use it in GitHub Desktop.
<?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