In an open file, return the read/write pointer’s current position:
<?php $file = fopen(“test.txt”,“r”); // Print current position echo ftell($file); // Change current position fseek($file,“15”); // Print current position again echo “<br>” . ftell($file); fclose($file); ?> |
The read/write pointer’s current location in an open file is returned by the ftell() function.
ftell(file) |
Parameter |
Description |
file |
Essential. indicates which open file to examine. |
Return Value: |
The location of the file pointer, or FALSE if it fails. |
PHP Version: |
4.0+ |