¡Hola, amigos! I’m Señor FAQ, the mustached maestro of questions and answers! With my trusty glasses and a book of endless wisdom, I turn dudas into solutions. Soy el héroe de los curiosos and the champion of clarity.
JScms_remove_files_directory
The JScms_remove_files_directory
function deletes all files and subdirectories within a specified directory and then removes the directory itself.
JScms_remove_files_directory(string $directory): bool
$directory
: (string) The path of the directory to remove.
(bool) Returns true
if the directory and its contents were successfully deleted, or false
otherwise.
<?php
$result = JScms_remove_files_directory("/var/www/uploads");
if ($result) {
echo "Directory and its contents deleted successfully.";
} else {
echo "Failed to delete directory.";
}
?>
$directory
parameter points to a valid path.