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 (資源$處理)...