W3schools Php Recursive Functions Algorithm