September 2001
Intermediate to advanced
768 pages
32h 45m
English
bool rewind(resource file_handle) Rewinds a file pointer.
Returns:
TRUE on success; FALSE on error
Description:
Use this function to “rewind” a file pointer. It resets the pointer associated with the specified file handle to the beginning of the file.
Example:
$fh = fopen ("test.txt", "r");
while(!feof($fh)) {
$output = htmlspecialchars (fgets ($fh, 1024));
echo ("$output<br />");
}
// start again and read a line
rewind ($fh);
echo (fgets($fh, 1024));
fclose ($fh);
|
Read now
Unlock full access