How to zip a file in php
1 2 3 4 5 6 7 8 9 10 |
<?php $namofthefile='vasanthan.txt';//name of the file you want to zip $zip = new ZipArchive(); $zip->open('vasanthan.zip', ZipArchive::CREATE); $zip->addFile($namofthefile, $namofthefile); $zip->close(); ?> |