Get the App
SLTechnology News&Howtos  ›  Development  › 

How PHP uses the ftell () function

Shulou Source: shulou.com Published: 2022-06-01 02:34:02 09月21日 Update

This article mainly introduces PHP how to use the ftell () function, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor with you to understand.

Ftell ();-- returns the read / write location of the file pointer

Int ftell (resource $handle) / / returns the location of the file pointer specified by handle, that is, the offset in the file stream.

Parameter: handle: the file pointer must be valid and must point to a file that was successfully opened through fopen () or popen (). Ftell () returns an undefined error in additional mode (opening the file with the parameter "a").

Header ("Content-Type:Text/html;charset=utf8"); / / opens a file and read some data$fp = fopen ("d:/test/test.txt", "r"); $data = fgets ($fp, 4); / / where are we? echo ftell ($fp); / / result 3fclose ($fp) Thank you for reading this article carefully. I hope the article "how to use the ftell () function in PHP" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Tags: Files articles pointers functions locations parameters validity success that is value interest at the same time pointing more friends patterns knowledge results editing industry Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Xiaomi MySQL Microsoft macOS