fflush

(PHP 4 >= 4.0.1, PHP 5, PHP 7)

fflush锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷募锟�

说锟斤拷

fflush ( resource $handle ) : bool

锟斤拷锟斤拷锟斤拷强锟狡斤拷锟斤拷锟叫伙拷锟斤拷锟斤拷锟斤拷写锟斤拷 handle 锟侥硷拷锟斤拷锟斤拷锟街革拷锟斤拷锟斤拷源锟斤拷 锟缴癸拷时锟斤拷锟斤拷 TRUE锟斤拷 锟斤拷锟斤拷锟斤拷失锟斤拷时锟斤拷锟斤拷 FALSE锟斤拷

锟侥硷拷指锟斤拷锟斤拷锟斤拷锟斤拷锟叫э拷模锟斤拷锟斤拷锟街革拷锟斤拷锟� fopen() 锟斤拷 fsockopen() 锟缴癸拷锟津开碉拷锟侥硷拷(锟斤拷锟斤拷未锟斤拷 fclose() 锟截憋拷)锟斤拷

锟斤拷锟斤拷

handle

锟侥硷拷指锟斤拷锟斤拷锟斤拷锟斤拷锟叫э拷模锟斤拷锟斤拷锟街革拷锟斤拷锟� fopen() 锟斤拷 fsockopen() 锟缴癸拷锟津开碉拷锟侥硷拷(锟斤拷锟斤拷未锟斤拷 fclose() 锟截憋拷)锟斤拷

锟斤拷锟斤拷值

锟缴癸拷时锟斤拷锟斤拷 TRUE锟斤拷 锟斤拷锟斤拷锟斤拷失锟斤拷时锟斤拷锟斤拷 FALSE锟斤拷

锟斤拷锟斤拷

Example #1 File write example using fflush()

<?php
$filename 
'bar.txt';

$file fopen($filename'r+');
rewind($file);
fwrite($file'Foo');
fflush($file);
ftruncate($fileftell($file));
fclose($file);
?>

锟轿硷拷

  • clearstatcache() - 锟斤拷锟斤拷募锟阶刺拷锟斤拷锟�
  • fwrite() - 写锟斤拷锟侥硷拷锟斤拷锟缴帮拷全锟斤拷锟节讹拷锟斤拷锟斤拷锟侥硷拷锟斤拷