How PHP uses the ftell () function
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!