set_time_limit(0);//设置PHP超时时间
    //$imagesURLArray = array_unique($imagesURLArray );
    $imagesURLArray = explode(";",$urlcoup);
    foreach($imagesURLArray as $imagesURL) {
        echo $imagesURL;
        echo "<br/>";
        file_put_contents(basename($imagesURL), file_get_contents($imagesURL));
    }
像这样,只能把文件保存到指定的路径啊~~~

解决方案 »

  1.   

    手册上的例子,简单合并了一下
    <?php
    $zip = new ZipArchive();
    $filename = "./download.zip";if ($zip->open($filename, ZIPARCHIVE::CREATE)!==TRUE) {
        exit("cannot open <$filename>\n");
    }$zip->addFromString("testfilephp.txt" . time(), "#1 This is a test string added as testfilephp.txt.\n");
    $zip->addFromString("testfilephp2.txt" . time(), "#2 This is a test string added as testfilephp2.txt.\n");
    $zip->addFile($thisdir . "/too.php","/testfromfile.php");
    $zip->close();
    header('Content-type: application/zip');
    header('Content-Disposition: attachment; filename="download.zip"');
    readfile($filename);
    ?>