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

SplFileObject::rewind

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

SplFileObject::rewindRewind the file to the first line

Açıklama

public SplFileObject::rewind(): void

Rewinds the file back to the first line.

Bağımsız Değişkenler

Bu işlevin bağımsız değişkeni yoktur.

Dönen Değerler

Hiçbir değer dönmez.

Hatalar/İstisnalar

Throws a RuntimeException if cannot be rewound.

Örnekler

Örnek 1 SplFileObject::rewind() example

<?php
$file
= new SplFileObject("misc.txt");

// Loop over whole file
foreach ($file as $line) { }

// Rewind to first line
$file->rewind();

// Output first line
echo $file->current();
?>

Ayrıca Bakınız