Php retrieves the content of a website and saves it as TXT. next time, it reads the content of a website directly from the txt file and saves it as TXT. next time, it reads the content directly from the txt file.
File_put_contents seems to be saved!
How to write it! No!
The code is as follows!
$line) { preg_match_all('|([^<>]+)|',$line,$result); $swfurl=$result[1][0]; if(!empty($swfurl)) return $swfurl; } } ?>
Reply to discussion (solution)
After obtaining the flash path, do you want to write the path to a text file?
.. Write a complete pull! No!
You want
Echo preg_replace ("/[&,?] /"," ", $ Flashurl );
Is the result written to the file?
$ S = preg_replace ("/[&,?] /"," ", $ Flashurl );
File_put_contents('file name .txt ', $ s );
Reply upstairs
:
I want
$ S = preg_replace ("/[&,?] /"," ", $ Flashurl); // obtain the result
File_put_contents('news.txt ', $ s); // save it to the txt file! Cache
// A lot of content is obtained! If flash URL obtains a news.txt file and saves it, the flash URL will be overwritten before it obtains other content! I have tested the content in news.txt!
// Save it! Http://bbs.csdn.net/1.php? Http://bbs.csdn.net/topics/
For example! The content is saved! When accessing this address! Not in the http://bbs.csdn.net/topics/ this get content directly re-news.txt saved content to get!
// A lot of content is obtained! If flash URL obtains a news.txt file and saves it, the flash URL will be overwritten before it obtains other content! I have tested the content in news.txt! How can we solve this problem by saving all the acquired data to a txt file or after several MB! Regenerate the news.txt news2.txt file! You need to save all the content obtained from none of the addresses! Next time you access the same address! Save it! Http://bbs.csdn.net/1.php? Http://bbs.csdn.net/topics/
For example! The content is saved! When accessing this address! Not in the http://bbs.csdn.net/topics/ this get content directly re-news.txt saved content to get!
Is there an append method?
You just need to take a closer look at the description of the file_pu_contents function, and your questions will no longer exist.
What really needs to be considered is: how do you separate multiple groups of data stored in one file?