PHP ftell() Functie
❮ Referentie voor PHP-bestandssysteemVoorbeeld
Retourneer de huidige positie van de lees-/schrijfaanwijzer in een geopend bestand:
<?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);
?>
Definitie en gebruik
De functie ftell() retourneert de huidige positie van de lees-/schrijfaanwijzer in een geopend bestand.
Syntaxis
ftell(file)
Parameterwaarden
Parameter | Description |
---|---|
file | Required. Specifies the open file to check |
Technische details
Winstwaarde: | De positie van de bestandsaanwijzer, of ONWAAR bij een fout. |
---|---|
PHP-versie: | 4.0+ |
❮ Referentie voor PHP-bestandssysteem