0
$html = file_get_html('http://www.csfd.cz/hledat/?q=Rychle+a+zb%C4%9Bsile+2001');
此代碼:
<div id="search-films" class="ct-general th-1">
<h2 class="header">Filmy</h2>
<div class="content">
<ul class="ui-image-list js-odd-even">
<li>
<a href="/film/1616-rychle-a-zbesile/"><img src="//img.csfd.cz/files/images/film/posters/000/001/1619_405078.jpg?h180" alt="poster" class="film-poster-small image" /></a>
<div>
<h3 class="subject"><a href="/film/1616-rychle-a-zbesile/" class="film c1">Rychle a zběsile</a></h3>
<p>Akční/Krimi, USA/Německo, 2001</p>
<p>
Režie: <a href="/tvurce/2850-rob-cohen/">Rob Cohen</a><br>
Hrají: <a href="/tvurce/2218-paul-walker/">Paul Walker</a>, <a href="/tvurce/129-vin-diesel/">Vin Diesel</a><br>
</p>
<div class="clear"></div>
</div>
</li>
</ul>
如何只有這個:img.csfd.cz/files/images/film/posters/000/001/1619_405078.jpg?h180這/電影/ 1616-rychle-a-zbesile/...?感謝您的幫助
'<?php include'simple_html_dom.php'; $ html = file_get_html('http://www.csfd.cz/hledat/?q=Rychle+a+zb%C4%9Bsile+2001'); $ html = new simple_html_dom(); $ html-> load(YOUR_HTML_CONTENT); ($ html-> find('img')as a) echo $ a-> src;' – BeFa
注:未定義的常量ROOT的使用 - 假設 '根' 在d:(!)\ wamp64 \ WWW \ csfd \ simple_html_dom.php上線76 調用堆棧 #\t時間\t內存\t功能\t位置 0.0005 {主}()\t ... \的index.php:0 \t 0.0064 754400 \t file_get_html()\t ... \的index.php:7 \t 0.0065 759856 \t get_curl()\t .. 。\ simple_html_dom.php:100 (! )公告:未定義的常量ROOT的使用 - 假設 '根' 在d:\ wamp64 \ WWW \ csfd \ simple_html_dom.php上線77 調用堆棧 #\t時間\t內存\t功能\t位置 0.0005 {主}()\t ... \的index.php:0 \t 0.0064 754400 \t file_get_html()\t ... \的index.php:7 – BeFa
包括( 「simple_html_dom.php」); $ html = file_get_html('http://www.csfd.cz/hledat/?q=Rychle+a+zb%C4%9%E2%80%8C%E2%80%8BBsile+2001'); ($ html-> find('img')as a) echo $ a-> src。 '
'; –