當前位置: 首頁> 函數類別大全> zip_entry_read

zip_entry_read

讀取ZIP 文件中的一個打開的項目。
名稱:zip_entry_read
分類:未分類
所屬語言:php
一句話介紹:讀取ZIP 文件中的一個打開的項目。

定義和用法

zip_entry_read()函數從打開的zip 檔案項目中獲取內容。

如果成功,則返回項目的內容。如果失敗,則返回false。

實例

<? php
$ zip = zip_open ( “ test.zip” ) ;

如果( $ zip )
  {
  while ( $ zip_entry = zip_read ( $ zip ) )
    {
    Echo “ <p>” ;
    迴聲“名稱:” 。 zip_entry_name ( $ zip_entry ) 。 “ <br />” ;

    if ( zip_entry_open ( $ zip , $ zip_entry ) )
      {
      迴聲“文件內容:<br/>” ;
      $ contents = zip_entry_read ( $ zip_entry ) ;
      echo “ $ contents <br />” ;
      zip_entry_close ( $ zip_entry ) ;
      }
    Echo “ </p>” ;
  }

zip_close ( $ zip ) ;

}
? >

文法

zip_entry_read ( zip_entry , length )
參數 描述
zip_entry 必需。規定要讀取的zip 項目資源(由zip_read() 打開的zip 項目)。
length 可選。規定返回的字節數。默認是1024。
同類函數
熱門文章