-1

The XML file:

<urlset>
    <url>
         <loc>http://example.com/.../</loc>
         <lastmod>0000-00-00</lastmod>
         <priority>0</priority>
    </url>
    <url>
         <loc>http://example.com/...</loc>
         <lastmod>0000-00-00</lastmod>
         <priority>0</priority>
    </url>
</urlset>

How to get a list of links to the xml? (google translate)

foreach ($html->find('?????') as $element) {
    echo $element->src;
}   
René Höhle
  • 26,716
  • 22
  • 73
  • 82

1 Answers1

0

I assume you want a list of all "loc" elements.

$simpleObj = simplexml_load_string($xml);
$loc = $simpleObj->xpath('//loc');

foreach($loc as $url){
    echo $url;
}
Martin Müller
  • 2,565
  • 21
  • 32