php creating zips without path to files inside the zip

后端 未结 3 1926
无人共我
无人共我 2020-11-27 05:48

I\'m trying to use php to create a zip file (which it does - taken from this page - http://davidwalsh.name/create-zip-php), however inside the zip file are all of the folder

3条回答
  •  隐瞒了意图╮
    2020-11-27 06:08

    I think a better option would be:

    $zip->addFile($file,basename($file));
    

    Which simply extracts the filename from the path.

提交回复
热议问题