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
Rewind pointer to locate the problem! It seems that the rewind pointer has an error. what is the problem? The code is as follows: & nbsp; $ fpstr = fopen (& quot; php: // input & quot;, & quot; rb & quot ;);... slightly $ bin = fread ($ fpstr, 2); //
Rewind pointer to locate the problem! It seems that the rewind pointer has an error. what is the problem? The code is as follows: & nbsp; $ fpstrfopen (& quot; php: input & quot;, & quot; rb & quot ;);... $ binfread ($ fpstr, 2); read-only 2 bytes...
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
Introduction to PHP Standard Library (SPL) notes
SPL is the abbreviation of Standard PHP Library (PHP Standard Library.
The Standard PHP Library (SPL) is a collection of interfaces and classes that are meant to solve common problems.
According to
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 ()
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 ()
SPL provides multiple iterator classes that provide iterative access, filtering data, caching results, and controlling paging. , because PHP is always growing, I try to list all of the iteration classes in SPL. Some of the following iterator classes
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.