Home  >  Article  >  Backend Development  >  An example of extracting text from multiple news items at the same time_PHP tutorial

An example of extracting text from multiple news items at the same time_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 16:03:40768browse

本文为一个提取一批新闻网页中的文本的小程序,它可以将各篇新闻的内容存为以该新闻标题为文件名的文本文件。如有更好的处理方法,请和我联系:
lwx3069@sina.com
   这里以人民网中的“今日要闻”下的新闻为例.
($url) ? "" : $url = "http://www.unn.com.cn/GB/channel2/3/11/index.html"; // 今日要闻
if(isset($url)&&$url!="") {
$str = implode("",file($url));
$str_ary = explode("