Recursive Function

Example

http://www.lornajane.net/posts/2012/php-recursive-function-example-factorial-numbers

Get leaf nodes: