ftell
ftell
Returns the current position of the file read/write pointer
**ftell** resource $stream
Returns the position of the file pointer referenced by .
stream
stream
The file pointer must be valid, and must point to a file successfully
opened by or .
gives undefined results for append-only streams
(opened with "a" flag).
fopen``popen``ftell
Returns the position of the file pointer referenced by
as an integer; i.e., its offset into the file stream.
stream
If an error occurs, returns false.
Voorbeeld: example
<?php
// opens a file and read some data
$fp = fopen("/etc/passwd", "r");
$data = fgets($fp, 12);
// where are we ?
echo ftell($fp); // 11
fclose($fp);
?>
fopen``popen``fseek``rewind