The rewind() function "rewinds" the position of the file pointer to the beginning of the file.This function returns TRUE on success, or FALSE on failure.
bool rewind ( resource $handle )
Sets the file position indicator for handle to the beginning of the file stream.
If you have opened the file in append ("a" or "a+") mode, any data you write to the file will always be appended, regardless of the file pointer position.
The above example will output something similar to : -
Foolly long sentence.
Parameter | Description |
---|---|
handle | The file pointer must be valid, and must point to a file successfully opened by fopen(). |