file_unmanaged_delete_recursive

function file_unmanaged_delete_recursive

file_unmanaged_delete_recursive($path)

Deletes all files and directories in the specified filepath recursively.

If the specified path is a directory then the function will call itself recursively to process the contents. Once the contents have been removed the directory will also be removed.

If the specified path is a file then it will be passed to file_unmanaged_delete().

Note that this only deletes visible files with write permission.

Parameters

$path: A string containing either an URI or a file or directory path.

Return value

TRUE for success or if path does not exist, FALSE in the event of an error.

See also

登录查看完整内容