PHP reads data from one TXT file, and writes the matching data to another TXT file.
Source: Internet
Author: User
PHP reads data from a TXT file. after matching, it writes data to another TXT file. I want to use PHP to read data from a TXT file. after matching, it writes data to another TXT file, I don't know what the problem is. after each execution, I only write the last one that meets the conditions (just one). I hope all the conditions are met. I hope you can give me some advice! & Lt ;? Php $ path = 'AA. tx PHP reads data from a TXT file and writes the matching data to another TXT file.
I want to use PHP to read data from a TXT file, and write the matching data to another TXT file. The following is the code and I don't know what the problem is, after each execution, only the last qualified (just one) will be written. I want all qualified, and hope you can give me some advice!
$ Path parameter 'aa.txt ';
$ Fp = fopen ($ path, "r ");
$ Str = file_get_contents ($ path); // Obtain the content
$ Arr = explode ("\ n", $ str); // store a branch to an array
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.