使用PHP DOM停止将图像放入noscript标记中 [英] Stop images from being put in noscript tags with PHP DOM
本文介绍了使用PHP DOM停止将图像放入noscript标记中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图从我想在自己的网页上显示的网页编辑图像src,如下所示:
I've tried to edit the image src from a webpage I want to show on my own webpage, like this:
$imgs = $doc->getElementsByTagName('img');
foreach($imgs as $img) {
$img->setAttribute("src", "http://www.futwiz.com" . $img->getAttribute("src"));
}
但它会在视图源上显示,并且不会下载图像。有人知道如何解决这个问题吗?
But it shows up on the view source as this, and is not downloading the images. Does anybody know how to fix this?
<div class="card-15-face"><img data-cfsrc="/assets/img/fifa15/faces/167305.png" src="http://www.futwiz.com"><noscript><img src="http://www.futwiz.com/assets/img/fifa15/faces/167305.png"></noscript></div>
推荐答案
imgs =
imgs =
doc-> getElementsByTagName(' < span class =code-string> img');
foreach(
doc->getElementsByTagName('img'); foreach(
imgs as
这篇关于使用PHP DOM停止将图像放入noscript标记中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文