Question

Is there any downside to using unlink() to delete a folder (and its contents) in php?

Was it helpful?

Solution

You can't. unlink can only delete files, not directories. You can delete directories with rmdir, but that will only delete empty directories. You will have to unlink individual files first.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top