所以我有以下代码:
$z = new ZipArchive();
$zopen = $z->open('https://github.com/AdamKyle/Aisis-Framework/archive/Aisis1.1.7.zip', 4);
if ($zopen === true) {
for ($i = 0; $i < $zip->numFiles; $i++) {
$filename = $zip->getNameIndex($i);
var_dump($filename);
}
} else {
echo "fail";
}
exit;
它不断导致失败。我提供的 URL 在浏览器中适用于我,但不适用于上述代码。这是怎么回事?
更新
我被问到什么结果:
var_dump(stream_get_wrappers());
是,他们在下面
array (size=12)
0 => string 'https' (length=5)
1 => string 'ftps' (length=4)
2 => string 'compress.zlib' (length=13)
3 => string 'compress.bzip2' (length=14)
4 => string 'php' (length=3)
5 => string 'file' (length=4)
6 => string 'glob' (length=4)
7 => string 'data' (length=4)
8 => string 'http' (length=4)
9 => string 'ftp' (length=3)
10 => string 'phar' (length=4)
11 => string 'zip' (length=3)