() Fungsi PHP ftell
Definisi dan Penggunaan
ftell () mengembalikan fungsi posisi saat ini di file terbuka.
Mengembalikan posisi saat ini dari pointer file, pada kembali kegagalan SALAH.
tatabahasa
ftell(file)
参数 | 描述 |
---|---|
file | 必需。规定要检查的已打开文件。 |
contoh
<?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);
?>
$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);
?>
Kode di atas akan menampilkan:
0
15
15
Lengkapi manual PHP Filesystem Referensi