定义和用法ftell() 函数返回在打开文件中的当前位置。 返回文件指针的当前位置,如果失败则返回 FALSE。 语法ftell(file)
参数 | 描述 |
---|
file | 必需。规定要检查的已打开文件。 |
实例<?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);?> 上面的代码将输出: 015
下载地址: PHP fstat() 函数 PHP ftruncate() 函数 |