¡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_single_File
The JScms_remove_single_File
function deletes a specified file from a given directory.
JScms_remove_single_File(string $directory, string $filename): string
$directory
: (string) The directory containing the file.$filename
: (string) The name of the file to delete.
(bool) Returns true
if the file was successfully deleted, or false
otherwise.
<?php
$result = JScms_remove_single_File("/var/www/uploads", "example.txt");
if ($result) {
echo "File deleted successfully.";
} else {
echo "Failed to delete file.";
}
?>
$filename
exists in the specified $directory
.