Return the current position of the read/write pointer in an open file:
<?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);
?>
Run Example »
The ftell() function returns the current position of the read/write pointer in an open file.
ftell(
file)
Parameter | Description |
---|---|
file | Required. Specifies the open file to check |
Return Value: | The file pointer position, or FALSE on failure. |
---|---|
PHP Version: | 4.0+ |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!