Advanced application of PHP file processing - file pointer PHP can realize the positioning and query of file pointers, thereby realizing fast query of required information. The file pointer functions include rewind(), fseek(), feof() and ftell() function. In the previous article "Advanced Application of PHP File Processing—Remote File Access and Locking Files" we introduced remote access to files and how to lock files. Friends who haven't read it can go and take a look. I won't cover it here. Enough talk, today we mainly talk about the functions in the file pointer! 1: rewind() function This function sets the pointer of the file handle to the beginning of the file stream. The syntax format of this function is as follows: bool rewind (resource $handle) Note: If the file is opened in append ("a") mode, then Any data written to a file will always be appended to the end of the existing contents of the file, regardless of the position of the file pointer! 2: fseek() function The fseek() function realizes the positioning of the file pointer. The syntax format of this function is as follows:
1. 10 recommended articles about the PHP fseek() function
Introduction: An advanced application of PHP file processing - file pointer PHP can realize the positioning and query of file pointers, thereby achieving For quick query of required information, the file pointer functions include rewind(), fseek(), feof() and ftell() functions. In the previous article "Advanced Application of PHP File Processing—Remote File Access and Locking Files" we introduced remote access to files and how to lock files. Friends who haven't read it can go and take a look. I won't cover it here. Enough talk, today we mainly talk about the functions in the file pointer! 1: rewind(...
2. 10 recommended articles about the php feof() function
##Introduction: An advanced application of PHP file processing - file pointer PHP can realize the positioning and query of file pointers, thereby realizing fast query of required information. The file pointer function has rewind (), fseek(), feof() and ftell() functions. In the previous article "Advanced Applications of PHP File Processing - Remote File Access and Locking Files" we introduced remote access to files and how to lock files. , friends who haven’t seen it, you can go and take a look, I won’t go into details here, today we mainly talk about the functions in the file pointer! 1: rewind(...
##3 .Advanced application of PHP file processing - file pointer
Introduction: PHP can implement file pointers Positioning and query, so as to achieve fast query of the required information. The file pointer functions include rewind(), fseek(), feof() and ftell() functions.
##4. ##php development file pointer, file locking
## Introduction:: This article mainly introduces php For development file pointers and file locking, students who are interested in PHP tutorials can refer to
##5.http://www.12306.cn/mormhweb/ PHP generation. File
Introduction: http://www.12306.cn/mormhweb/:http://www.12306.cn/mormhweb/ PHP generated file: function rw_counterfile() { $fp=fopen("counter.txt","r+"); if($fp==NULL) echo "File processing error"; rewind($fp);//The pointer moves to the file header fseek ($fp, 2);//Move the pointer backward 2 $point=ftell($fp);// echo $point." ;";// fp##6.
php generate file_PHP tutorial##Introduction: php generate file. ? functionrw_counterfile() { $fp=fopen("counter.txt","r+") ; if($fp==NULL)echo "File processing error"; rewind($fp);//The pointer moves to the beginning of the file fseek($fp,2);//The pointer moves back 2 $point=ftell($
7. Newcomer question: I don’t understand the solution to ftell()
Introduction: Newcomer question: Don’t understand ftell()In this example, the output is: 13. If 15 is changed to a relatively large number such as 1046, 13 is also output; if 15 is changed to 13, then 12 is output. What is going on? ------Solution-- 8. Newcomer question: I don’t understand the ftell() solution Introduction: Newcomer question: Don’t understand ftell()In this example, the output is: 13. If 15 is changed to a relatively large number such as 1046, 13 is also output; if 15 is changed to 13, then 12 is output. What is going on? ------Solution-- 9. PHP moving file pointer ftell(), fseek(), rewind() function summary Introduction: This article mainly introduces a summary of the PHP mobile file pointer ftell(), fseek(), and rewind() functions. This article first explains their functions and then gives specific uses. For example, friends who need it can refer to 10. File operation function_PHP Introduction: PHP3.0 The file operation functions in C are generally similar to those in C, but there are some extensions. In particular, in addition to supporting access to local files, it also supports access to HTTP and FTP URLs. Just pass these URLs to the file operation functions as file names. That’s it. The main file operation functions are: (1)fclose, feof, fgetc, fgets, fopen, fputs, fseek, ftell, mkd The above is the detailed content of 10 recommended articles about php ftell() function. For more information, please follow other related articles on the PHP Chinese website!