deleteme php file code example Example 1: php how to delete file if(file_exists($file)) { unlink($file); } Example 2: delete file in php unlink(filepath);