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 "advanced application for PHP file processing-remote file access and file locking", we introduced the remote access to files and how to lock files, let's take a look. I will not talk about it much here. today we will mainly talk about functions in file pointers! I. rewind (... 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 "advanced application for PHP file processing-remote file access and file locking", we introduced the remote access to files and how to lock files, let's take a look. I will not talk about it much here. today we will mainly talk about functions in file pointers! I. rewind () function this function sets the pointer of the handle file to the beginning of the file stream. the syntax format of this function is as follows: bool rewind (resource $ handle) note: if you open the file and append ("a") mode, any data written to the file will always be appended to the end of the existing content of the file, no matter where the file pointer is located! II. fseek () function fseek () is used to locate file pointers. the syntax format of this function is as follows:
1. 10 articles about php fseek () functions are recommended.
Introduction: This article mainly introduces the file pointer and file lock of php Development. if you are interested in PHP tutorials, please refer to it.
5. http://www.12306.cn/mormhweb/ php file generation
Introduction: http://www.12306.cn/mormhweb/:http://www.12306.cn/mormhweb/ php file generation:
6. php file generation _ PHP Tutorial
Introduction: php generates files .? Functionrw_counterfile () {$ fp = fopen ("counter.txt", "r +"); if ($ fp = NULL) echo "file processing error"; rewind ($ fp ); // move the pointer to the file header fseek ($ fp, 2); // move the pointer back 2 $ point = ftell ($
7. questions from new users: do not understand ftell () solutions
Introduction: questions from new users: do not understand ftell () Output in this example: 13 if the value of 15 is changed to a large number such as 1046, 13 is also output; if the value of 15 is changed to 13, what is the output of 12? ------ Solution --
8. questions from new users: do not understand ftell () solutions
Introduction: questions from new users: do not understand ftell () Output in this example: 13 if the value of 15 is changed to a large number such as 1046, 13 is also output; if the value of 15 is changed to 13, what is the output of 12? ------ Solution --
9. PHP mobile file pointer ftell (), fseek (), rewind () function summary
Introduction: This article mainly introduces the PHP mobile file pointer ftell (), fseek (), rewind () function summary. This article first explains their functions, then, we will provide specific examples. For more information, see
10. File operation function _ PHP
Introduction: File operation functions in PHP3.0 are similar to those in C, but there are some extensions. in particular, in addition to accessing local files, PHP3.0 also supports accessing HTTP and FTP URLs, you only need to pass these URLs as file names to the file operation function. main file operation functions are: (1) fclose, feof, fgetc, fgets, fopen, fputs, fseek, ftell, mkd
The above is a detailed article about the php ftell () function. For more information, see other related articles in the first PHP community!