Posted by Erwin Moller on 09/13/05 13:10
betterdie@gmail.com wrote:
> Dear guru
>
> I want to delete all file and folder recursivly under php code, can
> anyone give me commend for this.
>
> Thank very much
Hi,
It is not too complicated.
But pay attention to potential problems concerning file and directory
permissions.
Remember that PHP runs as user 'nobody' or 'apache' or 'www-data' on most
*nix machines, and as IUSR_XXX on W$ machines/IIS.
That user needs appropriate right to delete files and directories.
For some reference and code-examples, start reading here:
http://nl2.php.net/dir
and
http://nl2.php.net/manual/en/ref.filesystem.php
You will probably use functions like rmdir() and unlink().
Good luck!
Regards,
Erwin Moller
[Back to original message]
|