时间:2021-07-01 10:21:17 帮助过:16人阅读

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函数怎么用的详细内容,更多请关注Gxl网其它相关文章!