• AddThis Social Bookmark Button

    Add to Technorati Favorites

  • Archives

  • opening and extracting a zip file

    By krates | May 1, 2008

    Well zipping is not a php function. For the zipping functions to work on your server you must download the

    Download the ZZIPlib library

    Download the Zip PELC extension

    And install them ( find the instruction there only on how to )

    The example i am going to tell is a simple one

    <?php
    $zipfile = new ZipArchive;
    $zipfile->open(‘file.zip’);
    $zipfile->extractTo(‘./’);
    $zipfile->close();
    echo
    “the requested file has been extracted”;
    ?>

    open = open the specified zip file inside the braces

    extractTo = extract the opened zip file to the location specified

    close = closes a zip file

    Thanks

    krates

    Share and Enjoy:
    • del.icio.us
    • Technorati
    • Digg
    • StumbleUpon
    • Ma.gnolia
    • Furl
    • Reddit
    • Slashdot
    • Spurl
    • YahooMyWeb

    Topics: Php |

    Related Links:

    Comments