how to compress a file code example
Example 1: php how to delete file
if(file_exists($file)) {
unlink($file);
}
Example 2: how to tar a file
tar -czvf name-of-archive.tar.gz /path/to/directory-or-file
if(file_exists($file)) {
unlink($file);
}
tar -czvf name-of-archive.tar.gz /path/to/directory-or-file