//////////////////////php代码部分
public function snoopy()
{
require_once APP_PATH . 'Home/Model/Snoopy.class.php';
//include 'Home/Model/Snoopy.class.php'; //加载Snoopy类
$snoopy = new \Snoopy(); //实例化一个对象
$sourceURL = "http://www.ithome.com/"; //要抓取的网页
$snoopy->fetch($sourceURL);//获取所有内容
$conn = $snoopy->results;
//print_r(utf8_encode($a));
$c 'utf-8');
$pregContent = "/
(.*?)
/iU";
preg_match_all($pregContent, $content, $contentArray);//匹配内容到arr数组
$connEnd = $contentArray[1][0];
// $kaishi="lst lst-1 new-list";
// $jieshu="page_nav";
// $kaishizishu = stripos($content,$kaishi);
// $jieshuzishu = stripos($content,$jieshu);
// $connEnd = substr($content,$kaishizishu+ strlen($kaishi), $jieshuzishu - ($kaishizishu + strlen($kaishi)));
$connEnd = str_replace("
- ","",$connEnd);
$connEnd = str_replace("