私はこのようなindex.htmlコードを持っています
<div class="photoImg">
<img src="http://host.com/images/image-name.jpg" alt="image" />
</div>
このコードを使用して、画像の URL を見つけます ( http://host.com/images/image-name.jpg )
<?php
include('simple_html_dom.php');
$url = "index.html";
echo $url;
foreach($html->find('div.photoImg') as $photo){
$item['src'] = $photo->find('img', 0)->src;
$photo[] = $item;
}
print_r($photo);
?>
しかし、うまくいきません。誰でも私のコードを修正するのを手伝ってくれますか!