如题。
我在采集时用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];
我在采集时用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];
$strContent = @file_get_contents($getUrl);preg_match($strPattern, $strContent, $strResult);
print_r($strResult); // 看一下整个数组
echo $strContent;
echo $strContent = file_get_contents($getUrl);
$strPattern = '/<!--主体-->(.+)<!--END主体-->/s';否则要做编码转换动作
$strPattern = iconv('gbk','utf-8','/<!--主体-->(.+)<!--END主体-->/s');