Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php delete file

// 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 by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #delete #file
ADD COMMENT
Topic
Name
5+2 =