如题。
我在采集时用preg_match($strPattern, $strContent, $strResult);现在返回的数据,发现里面内容太多。无法输出,应该如何解决啊。
在线等,先谢谢了。~~代码附上:$getUrl = 'http://moneyflow.cnfol.com/dp.asp';$strPattern = '/<!--主体-->(.*?)<!--END主体-->/is';
$strContent = @file_get_contents($getUrl);preg_match($strPattern, $strContent, $strResult);
echo $strResult[1];

解决方案 »

  1.   

    $getUrl = 'http://moneyflow.cnfol.com/dp.asp';$strPattern = '/<!--主体-->(.*)<!--END主体-->/is';
    $strContent = @file_get_contents($getUrl);preg_match($strPattern, $strContent, $strResult);
    print_r($strResult); // 看一下整个数组
      

  2.   

    $strContent = file_get_contents($getUrl);
    echo $strContent;
      

  3.   

    先确认能得到数据
    echo $strContent = file_get_contents($getUrl);
      

  4.   

    copy lz代码到本地没发现问题,正确匹配到最后一行,也就是从匹配开始到2007-7-25那条
      

  5.   

    如果你的程序文本是 utf-8 编码的
    $strPattern = '/<!--主体-->(.+)<!--END主体-->/s';否则要做编码转换动作
    $strPattern = iconv('gbk','utf-8','/<!--主体-->(.+)<!--END主体-->/s');