PHP头条
热点:

用phpquery采集的有关问题


用phpquery采集的问题
我用phpquery采集网页的内容

以下是

phpQuery::newDocumentFile($url); 
$img=pq('.productImageGrid #prodImageCell')->html();
echo $img;
$img_txt=pq('.productImageGrid #prodImageCell')->text();


$img_txt是空值,没内容
$img 不管是echo还是print_r都是显示图片
请问$img怎么转成字符串,我需要存入数据库。




以上为浏览器里面显示的代码,我就想这些代码存入数据库。

分享到:
------解决方案--------------------
既然是字符串直接存入数据库就是了

www.phpzy.comtrue/phprm/9923.htmlTechArticle用phpquery采集的有关问题 用phpquery采集的问题 我用phpquery采集网页的内容 以下是 phpQuery::newDocumentFile($url); $img=pq('.productImageGrid#prodImageCell')->html(); echo$img; $img_txt=pq('.productImageGrid#prodImag...

相关文章

相关频道:

PHP之友评论

今天推荐