-1

谁能帮我使用 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>
4

1 回答 1

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>';
}
于 2013-06-13T11:56:01.390 回答