array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'splfileobject.fflush.php', 1 => 'SplFileObject::fflush', 2 => 'Flushes the output to the file', ), 'up' => array ( 0 => 'class.splfileobject.php', 1 => 'SplFileObject', ), 'prev' => array ( 0 => 'splfileobject.eof.php', 1 => 'SplFileObject::eof', ), 'next' => array ( 0 => 'splfileobject.fgetc.php', 1 => 'SplFileObject::fgetc', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/spl/splfileobject/fflush.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

SplFileObject::fflush

(PHP 5 >= 5.1.0, PHP 7, PHP 8)

SplFileObject::fflushFlushes the output to the file

Beschreibung

public SplFileObject::fflush(): bool

Forces a write of all buffered output to the file.

Parameter-Liste

Diese Funktion besitzt keine Parameter.

Rückgabewerte

Gibt bei Erfolg true zurück. Bei einem Fehler wird false zurückgegeben.

Beispiele

Beispiel #1 SplFileObject::fflush() example

<?php
$file
= new SplFileObject('misc.txt', 'r+');
$file->rewind();
$file->fwrite("Foo");
$file->fflush();
$file->ftruncate($file->ftell());
?>

Siehe auch