factorial function php
function Factorial($number){
if($number <= 1){
return 1;
}
else{
return $number * Factorial($number - 1);
}
}
$number = 5;
$fact = Factorial($number);
echo "Factorial = $fact"; //output : 120
?>
Also in PHP:
- current datetime php
- array_key_exists contains string
- clear array php
- Your Composer dependencies require the following PHP extensions to be installed: dom, mbstring, xml, xmlwriter
- check session in blade laravel
- convert string to date php
- database seeder laravel 8
- composite unique between two columns laravel migration
- e error reporting all
- add one day to date in php
- Database name seems incorrect You're using the default database name laravel. This database does not exist. Edit the .env file and use the correct database name in the DB_DATABASE key.
- decode ' php
- check if array is duplicate and get the latest values php
- clear view cache laravel
- Str::random() example
- check if string has a string php
- actual url php
- Uncaught RedisException: Redis server went away in
- echo ternary php
- cache clear in laravel command
- array key contains php
- event click right mouse
- file_get_contents(): SSL: The operation completed successfully but file_get_contents(http://www.b2bsoftwareking.com): failed to open stream: No connection could be made because the target machine actively refused it. in
- check if key array php