2014-09-22 78 views
0
<strong><a href="http://www.flickr.com/photos/therevsteve/5152424274/sizes/l/"> 
<img src="http://www.brightknowledge.org/knowledge-bank/teaching/teaching-in-private- schools/@@images/77cbbd71-bbf5-4fb6-a017-cc61016b6f60.jpeg" alt="Teaching in private schools" class="image-right" title="Photo by Steve Day" /></a> 
There are big differences between teaching in independent and state schools. Find out about the most important ones here.</strong><img src="http://www.brightknowledge.org/++resource++brightside.theme.images/badge.png" /> 

这里是我的HTML.I能够一个接一个地获取img标签。HTML中有多个img标签。如何使用PHP获取这些img标签?如何从html中使用php获取多个img标签?

+0

你是从获取这些标签试试? – Khushboo 2014-09-22 07:41:43

+0

你的意思是你想用PHP获得所有的DOM标签吗? – 2014-09-22 08:10:47

回答

0

您可以使用XPath查询所有img节点。

The DOMXPath class 在页面底部有一个很好的样本。

0

你可以用这个

preg_match_all('/<img[^>]+>/i',$html, $allTags); 

print_r($allTags);