delete_files()

delete_files($path[, $del_dir = FALSE[, $htdocs = FALSE]])

Parameters:
  • $path (string) – Directory path
  • $del_dir (bool) – Whether to also delete directories
  • $htdocs (bool) – Whether to skip deleting .htaccess and index page files
Returns:

TRUE on success, FALSE in case of an error

Return type:

bool

Deletes ALL files contained in the supplied path.

Example:

delete_files('./path/to/directory/');

If the second parameter is set to TRUE, any directories contained within the supplied root path will be deleted as well.

Example:

delete_files('./path/to/directory/', TRUE);

Note

The files must be writable or owned by the system in order to be deleted.

doc_CodeIgniter
2016-10-15 16:32:15
Comments
Leave a Comment

Please login to continue.