factorial function php

Solutions on MaxInterview for factorial function php by the best coders in the world

showing results for - "factorial function php"
Valeria
26 Oct 2018
1function Factorial($n) {
2  	return ($n <= 1) ? 1 : $n * Factorial($n - 1);
3}
Henri
24 Jan 2018
1function Factorial($number){ 
2    if($number <= 1){   
3        return 1;   
4    }   
5    else{   
6        return $number * Factorial($number - 1);   
7    }   
8} 
9  
10$number = 5; 
11$fact = Factorial($number); 
12echo "Factorial = $fact";  //output : 120
13?> 
queries leading to this page
write a function to calculate factorial of given number phpwrite a php program to calculate factorial of a number the user should give the input factor trinomial phpfactorial program in phpfactorial of a number in php using functionwhat is factorial number in phpfactorial program loop in phpphp factorial numberfactorial numero phpcreating factorial in php and return in htmlphp calculate factorialfactorial program phpfactorial en phpfactorial phpwrite a program to find the factorial of a number in phpfactorial of number in pgpfirst factorial phpphp factorial loopphp code for factorial of a numberfactorial php functionfactorial method phpif equal to factorial of number phpfactoriel en phpphp program to find factorial of a number using functionfind factorial of a number phpfactorial de 5 phpphp factoral method examplefactorial program in php using for loopfactorial og a number phpcalc factorial phpphp factorial functionhow to fiund a factorial of a number in phgpfactorial using for loop in phpfactorial in phpfactorial in table in php php program for factorial of a numberfind factorial using while in phpwrite a php program to find factorial of a number factorial number in phpphp factor 5cphp to find factorial of a numberfactorial by phpphp code to find factorial of a numberfactor phphow to get factorial table in phpwrite a program to find devisor or factorial of a program phpfactorial using function in phpfactorial in php using for loopfactoria phpphp factoriellefactoral php2 factor phphow to find factorial of a number in phpphp program to find factorial of a numberfactorial example in phpwrite a function to calculate the factorial of a number in phptake a number as parameter and returns its factorial in phpfactorial of a number in php using classesphp factorialhow to find a factorial in phpfactorial of a number in phptake a number as parameter and returns its factorial in php using functionscalculating factorials phpphp factorial programfactorial of 5 in phphow to write a function in php to get the factorial of a given numberfactorial of n number in phphow to find factorial of a number php using whilewap to factorial of a number in phpwrite php script to find factorial of a function using functionsfactorial function phpfactorial of number in phpcalcular factoriales phpfind factorial of a number in phpcreating factorial in phpfactorial function php