Jump to content

PHP XML Parser Question


nottingham

Recommended Posts

<?php
$dom = new DOMDocument();
$dom->loadHTMLFile('http://en.wikipedia.org/wiki/Liverpool_F.C.');
$domxpath = new DOMXPath($dom);
foreach ($domxpath->query('//span[@id="Players"]/../following-sibling::table[1]//span[@class="fn"]') as $a)
{echo
"
<p>$a->textContent</p>
";
};
?>

 

Hello, how can I parse an XML that includes all of the $a->textContent with a tag like <player></player>?

Link to comment
https://forums.phpfreaks.com/topic/245776-php-xml-parser-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.