php zip_open 返回成功判断

resource zip_open ( string $filename ) 打开一个新的ZIP归档文件进行读取。

filename 待打开ZIP归档的文件名。

Note that the Zip functions return an integer error number in the event of error. So:

<?php
$zip = zip_open($file);

if ($zip) {
?>

is incorrect. Instead use:

<?php
$zip = zip_open($file);

if (is_resource($zip)) {
?>

 

posted on 2018-03-02 11:46  ZhYQ_note  阅读(323)  评论(0)    收藏  举报

导航