No error when creating zip, but it doesn't get created

前端 未结 6 1188
醉梦人生
醉梦人生 2021-02-18 15:38

I wrote this code to create a ZIP file and to save it. But somehow it just doesn\'t show any error, but it doesn\'t create a ZIP file either. Here\'s the code:

$         


        
6条回答
  •  迷失自我
    2021-02-18 16:24

    break it into steps.

    if ($res === TRUE) {
    
      check if file_exist
    
    check if addFile give any error
    }
    
    if($zip->close())
    {
     $zip_created = true; 
        echo "FILE ADDED!"
    }
    

    Check the phpinfo for zip is enabled or not :)

提交回复
热议问题