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 () function. In the previous article, "PHP File processing advanced Applications-remote file access and lock files" we introduced the remote access to files and how to lock files, not to see the small partners, you can go to see, here is not much to say, today we mainly talk about the function of the file pointer! A: Rewind () function This function sets the pointer of the file handle to the beginning of the file stream, and the syntax of the function is as follows: BOOL Rewind (Resource $handle) Note: If you open the file with append ("a") mode, Then any data written to the file will always be appended to the end of the file, no matter where the file pointer is located! Two: Fseek () function fseek () function implements the positioning of the file pointer, the function syntax format is as follows:
1. About PHP Ftell () functions 10 articles recommended
Introduction: 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 () function. In the previous article, "PHP File processing advanced Applications-remote file access and lock files" we introduced the remote access to files and how to lock files, not to see the small partners, you can go to see, here is not much to say, today we mainly talk about the function of the file pointer! A: Rewind (...
2. About PHP fseek () functions 10 articles recommended
Introduction: 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 () function. In the previous article, "PHP File processing advanced Applications-remote file access and lock files" we introduced the remote access to files and how to lock files, not to see the small partners, you can go to see, here is not much to say, today we mainly talk about the function of the file pointer! A: Rewind (...
3. About PHP feof () functions 10 articles recommended
Introduction: 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 () function. In the previous article, "PHP File processing advanced Applications-remote file access and lock files" we introduced the remote access to files and how to lock files, not to see the small partners, you can go to see, here is not much to say, today we mainly talk about the function of the file pointer! A: Rewind (...
4. php File processing advanced Applications-remote file access and lock files
Summary: In PHP, in addition to the basic reading and writing of the file, you can also find the file pointer, locate, and lock the file being read, and so on.
5. PHP Flock function Instance _php tutorial
Introduction: PHP Flock function instance. Because Flock () requires a file pointer, you may have to use a special lock file to protect access to files that you intend to open through write mode (in the fopen () function, add W or
6. PHP4 User manual: Function-flock_php Tutorial
Summary: PHP4 user manual: Function-flock. Flock (php 3>= 3.0.7, PHP 4 >= 4.0.0) Flock--Lock file description bool Flock (int fp, int operation [, int wouldblock]) PHP support in Access Files when the file is completely locked (which means the
8. PHP About files and directories (1) Write file permissions three, lock file _php tutorial
Introduction: PHP About files and directories (1) Write file permissions three, lock file. PHP About files and directories (1) Write file permissions three, lock file one, file permissions in short, everything is to ensure the security of the directory, to ensure that the security of the directory than the guarantee file
9. Basic PHP Tutorial--Four file and directory learning summary
Introduction: PHP Basic Tutorial--4 File and Directory learning summary One, write file: $fp = fopen (filename, mode); Mode for open file mode such as ' A + ' means to read and write files, the file does not exist to create, the new data is added to the end of the file fwrite ($fp, write content); Fclose ($FP); two, lock file: When there are multiple users at the same time on the file operation to ensure that there is no conflict
"Related question and answer recommendation":
How to use C + + How to lock a part of a file by Lockfile, do not find a way to use it, can you give an example?