The ftell() function returns the current position in the open file.
Returns the current position of the file pointer, or FALSE on failure.
ftell(file)
parameter | describe |
---|---|
file | Required. Specifies the open file to be checked. |
<?php$file = fopen("test.txt","r");// print current positionecho ftell($file);// change current positionfseek($file,"15");// print current position againecho "<br />" . ftell($file);fclose($file);?>
The above code will output:
015