PHP中的ftell()函数
该ftell()函数返回打开文件中的当前位置。该函数返回当前文件指针位置。失败时,返回FALSE。
语法
ftell(file_pointer)
参数
file_pointer-使用创建的文件指针fopen()。需要。
返回
该ftell()函数返回当前文件指针位置。失败时,返回FALSE。
示例
<?php
$file_pointer = fopen("new.txt","r");
echo ftell($file_pointer);
fclose($file_pointer);
?>输出结果
0
让我们看看另一个示例,其中当前位置已更改。
示例
<?php
$file_pointer = fopen("new.txt","r");
//改变当前位置
fseek($file_pointer,"10");
//显示当前位置
echo ftell($file_pointer);
fclose($file_pointer);
?>以下是输出。返回当前位置。
输出结果
10
热门推荐
10 父亲简短结婚祝福语大全
11 宝宝生病简短祝福语大全
12 恭喜新郎父母简短祝福语
13 新年恋人祝福语简短创意
14 高考给舍友祝福语简短
15 兔年祝福语简短100字
16 上司生日祝福语简短 女性
17 祝福语老人简短话语
18 简短祝福语中考女孩的话