Home  >  Article  >  Backend Development  >  Supplementary information on how to convert excel to word and how to cross-site crawl pages from other sites

Supplementary information on how to convert excel to word and how to cross-site crawl pages from other sites

WBOY
WBOYOriginal
2016-07-29 08:34:411181browse

In actual applications, we often encounter some special situations, such as the need for news, weather forecast, etc. However, as a personal site or a small site, we cannot have so much manpower, material and financial resources to do these things. How? What to do?
Fortunately, the Internet is resource sharing. We can use programs to automatically capture pages from other sites and process them for our use.
What should I use? What the comrade gave me doesn’t work. In fact, Php has this function, which is to use the curl library. Please look at the code below!
$ch = curl_init ("http://dailynews.sina.com.cn");
$fp = fopen ("php_homepage.txt", "w");
curl_setopt ($ch, CURLOPT_FILE, $fp);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_exec ($ch);
curl_close ($ch);
fclose ($fp);
?>
But sometimes Some errors will appear, but the download is actually complete! I asked the foreigners, but they didn't give me an answer. I thought it wouldn't work, so just add a ◎; in front of the function. In this way, as long as we perform appropriate analysis on $txt, we can secretly grab Sina news! However, it’s better not to use it! To avoid legal disputes, I just want to tell you that Php is very powerful! There are many things you can do!
[The copyright of this article is jointly owned by the author and Aosuo.com. If you need to reprint, please indicate the author and source]

The above introduces how to convert excel into word and how to cross-site crawl the pages of other sites, including how to convert excel into word. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn