Problem Statement
What is recursion in PHP functions? Give an example.
Explanation
Recursion means a function calls itself until a condition is met. It is used in problems like factorial or tree traversal. Care must be taken to avoid infinite loops.
Code Solution
SolutionRead Only
function fact($n){ if($n==1) return 1; return $n*fact($n-1); }