downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

SplFileObject::fputcsv> <SplFileObject::flock
[edit] Last updated: Fri, 25 May 2012

view this page in

SplFileObject::fpassthru

(PHP 5 >= 5.1.0)

SplFileObject::fpassthruファイルポインタに残っているデータをすべて出力する

説明

public int SplFileObject::fpassthru ( void )

与えられたファイルポインタの現在位置から終端までを読み込み結果を出力バッファに書き出します。

既にデータをファイルに書き込んでいる場合、ファイルポインタをファイルの始めにリセットするために SplFileObject::rewind() を呼び出すことが必要になる場合があります。

パラメータ

この関数にはパラメータはありません。

返り値

handle から読み込まれ出力を通して渡された文字数を返します。

例1 SplFileObject::fpassthru() の例

<?php

// ファイルをバイナリモードでオープンする
$file = new SplFileObject("./img/ok.png""rb");

// 正しいヘッダを送出する
header("Content-Type: image/png");
header("Content-Length: " $file->getSize());

// 画像をダンプしてスクリプトを終了させる
$file->fpassthru();
exit;

?>

参考

  • fpassthru() - ファイルポインタ上に残っているすべてのデータを出力する



add a note add a note User Contributed Notes SplFileObject::fpassthru
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites