Php Script To Delete Files On Server

[Solved] Php Script To Delete Files On Server | Php - Code Explorer | yomemimo.com
Question : php how to delete file

Answered by : taylor-hawkes

if(file_exists($file)) {	unlink($file);
} 

Source : https://stackoverflow.com/questions/2371408/how-to-delete-a-file-via-php | Last Update : Mon, 20 Jan 20

Question : php delete file

Answered by : revaz-gh

// delete file function, if silent is false, function will throw exception
function deleteFile($fullFileName, $silent=0) { if (file_exists($fullFileName)) { unlink($fullFileName); return TRUE; } else { if ($silent == 1) { return FALSE; } else { throw new \InvalidArgumentException('File "'.$fullFileName.'" not exists.'); } }
}

Source : | Last Update : Mon, 27 Sep 21

Answers related to php script to delete files on server

Code Explorer Popular Question For Php