How Can I extract the image path from <ri:attachment ri:filename=“stories-img-05.png” />
问题 Here is the original code where I am extracted the data using Simple HTML Dom: <div class="content-wrapper"><p><ac:image ac:height="250"><ri:attachment ri:filename="stories-img-05.png" /></ac:image></p></div> Here is the code which i am using : $html->find('div[class=content-wrapper] p ac:image ', 0)->innertext; How can I get Image Path? 回答1: For multiple use this code: $img=array(); foreach($html->find('div.content-wrapper ri:attachment[ri:filename]') as $article) { array_push($img, $article