/ Published in: PHP
A recursive function is a function that has the ability to call itself (recursion). I ran into this problem while trying to delete a directory containing files and/or other directories. I was using FTP at the time so, the function will be written as such. It can be easily ported to using filesystem functions by following the same logic/flow.
URL: http://jrtashjian.com/2008/08/27/code-snippet-recursive-delete-with-ftp-2/