This article mainly introduces the PHP mobile file pointer ftell (), fseek (), rewind () function summary. This article first explains their functions, and then provides specific examples, for more information about how to read and write a file, you
In the process of reading and writing files, it is sometimes necessary to jump in a file, read in different locations, and write data to a different location. For example, you would need to move a file pointer to save data using a file emulation
Question: do not understand ftell () & lt ;? Php $ fp = fopen ('exa', 'r'); $ data = fgets ($ fp, 15); echoftell ($ fp); fclose ($ fp );? & Gt; output in this example: 13 if the value is changed to a relatively large number such as 1046, 13 is also
A Directory Operations
BaseName--Returns the file name portion of the path
DirName--Returns the directory portion of the path
PathInfo--Returns information about the file path
Realpath--Returns the normalized absolute path name
Copy CodeThe code is
PHP File processing advanced application-file pointer php can implement the positioning of the file pointer and query, so as to achieve the required information fast query, the file pointer function has rewind (), fseek (), feof () and Ftell ()
We know that the temporary declarations of variables are stored in memory, even static variables, after the script is finished will be released, so, want to save the content of a variable for a long time, one way is to write to the file, put on the
PHP advanced application for PHP file processing allows you to locate and query file pointers, so as to quickly query required information. file pointer functions include rewind (), fseek (), feof () and ftell () functions. In the previous article
PHP File processing advanced application-file pointer php can implement the positioning of the file pointer and query, so as to achieve the required information fast query, the file pointer function has rewind (), fseek (), feof () and Ftell ()
Details the php file directory base operation,
We know that the temporary declaration of the variable is stored in memory, even if it is a static variable, the script will be released after the run, so, want to persist the contents of a variable,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.