php ftell()函数怎么用?
php ftell()函数打开文件中的当前位置。
语法:
ftell(file)
参数:
● file:必需。规定要检查的已打开文件。
返回值:返回文件指针的当前位置,如果失败则返回 FALSE。
下面通过示例来看看php ftell()函数的使用方法。
示例
<?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); ?>
输出:
0 15
以上就是php ftell函数怎么用的详细内容,更多请关注php中文网其它相关文章!
声明:本文原创发布php中文网,转载请注明出处,感谢您的尊重!如有疑问,请联系admin@php.cn处理
上一篇:php fwrite函数怎么用 下一篇:php fputs函数怎么用