我用phpquery采集网页的内容以下是phpQuery::newDocumentFile($url); 
$img=pq('.productImageGrid #prodImageCell')->html();
echo $img;
$img_txt=pq('.productImageGrid #prodImageCell')->text();
$img_txt是空值,没内容
$img 不管是echo还是print_r都是显示图片
请问$img怎么转成字符串,我需要存入数据库。
<a href="http://www.amazon.co.jp/gp/product/images/B0081H9LQ8/ref=dp_image_0/376-1230581-7023067?ie=UTF8&amp;n=2127209051&amp;s=computers" target="AmazonHelp" onclick="return amz_js_PopWin(this.href,'AmazonHelp','width=700,height=600,resizable=1,scrollbars=1,toolbar=1,status=1');"><img onload="if (typeof uet == 'function') { if(typeof setCSMReq=='function'){setCSMReq('af');setCSMReq('cf');}else{uet('af');uet('cf');amznJQ.completedStage('amznJQ.AboveTheFold');} } " src="http://ec2.images-amazon.com/images/I/41dnPd2SSHL._SL500_AA280_.jpg" id="prodImage" width="280" height="280" border="0" alt="Android tablet " onmouseover=""></a>以上为浏览器里面显示的代码,我就想这些代码存入数据库。

解决方案 »

  1.   

     <form  name="form2" method="get" action="search_new_product_change.php?title=<?PHP echo $title; ?>&rank=<?PHP echo $title; ?>&price=<?PHP echo $amazon_price; ?>imgurl=<?PHP echo $img; ?>">现在不知道怎么输出$img ,因为要存入数据库的
    $img 类型是string的
      

  2.   

     <form name="form2" method="post" action="search_new_product_change.php?title=<?PHP echo $title; ?>&rank=<?PHP echo $rank; ?>&imgurl=<?PHP echo $imgurl[0][0]; ?>&currency=<?PHP  echo $currency=$amazon_currency($account);  ?>">请问我怎么输出给imgurl=
    我直接用ehco,就在页面上显示图片了