fpassthru -輸出所有剩餘的資料檔案指標_PHP教程

來源:互聯網
上載者:User
fpassthru -輸出所有剩餘的資料檔案指標

fpassthru
( PHP 4中, PHP 5中)

fpassthru -輸出所有剩餘的資料檔案指標

描述
國際fpassthru (資源$處理)
讀取EOF分析的特定檔案指標從當前的位置和結果寫入到輸出緩衝區。

您可能需要請倒帶( )重設檔案指標的開頭的檔案如果您已經寫入資料檔案。

如果您只想轉儲檔案內容的輸出緩衝區,而不首先修改或尋求特定抵消,您可能會想要使用readfile ( ) ,從而節省您fopen ( )函數的調用。

參數

把柄
檔案指標必須有效,必須指向一個檔案成功開啟fopen ( )或者fsockopen ( ) (和尚未關閉fclose ( ) ) 。


傳回值
如果出現錯誤, fpassthru ( )返回FALSE 。否則, fpassthru ( )返回的字元數讀取處理和通過輸出。

執行個體

例如# 1使用fpassthru ( )與二進位檔案

// open the file in a binary mode
$name = './img/ok.png';
$fp = fopen($name, 'rb');

// send the right headers
header("Content-Type: image/png");
header("Content-Length: " . filesize($name));

// dump the picture and stop the script
fpassthru($fp);
exit;

?>


http://www.bkjia.com/PHPjc/445466.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/445466.htmlTechArticlefpassthru -輸出所有剩餘的資料檔案指標 fpassthru ( PHP 4中, PHP 5中) fpassthru -輸出所有剩餘的資料檔案指標 描述 國際fpassthru (資源$處理)...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.