任何人都可以帮我解析使用simplehtmldom解析器的img src
<noscript><img alt="Tiergarten, Berlin" src="http://cdn1.gbot.me/photos/dg/mK/1284593632/Tiergarten__Berlin-Tiergarten-3000000027259-500x375.jpg" title="Tiergarten, Berlin" /></noscript>
答案 0 :(得分:1)
点击此链接http://simplehtmldom.sourceforge.net/
<?php
include 'simple_html_dom.php';
$html = str_get_html('<noscript><img alt="Tiergarten, Berlin" src="http://cdn1.gbot.me/photos/dg/mK/1284593632/Tiergarten__Berlin-Tiergarten-3000000027259-500x375.jpg" title="Tiergarten, Berlin" /></noscript>');
foreach($html->find('img') as $element) {
echo $element->src . '<br>';
}