KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Exmple feed: view-source: http://rss.packetstormsecurity.org/files/tags/exploit/ I only want to return sections of xml where the parent title node has matching text in it, in this example the text to match is "site". //get feed with curl $doc = new SimpleXmlElement($xml, LIBXML_NOCDATA); //$result = $doc->xpath('//title'); //this works returns all the <title>'s $result = $doc->xpath('//title[site]'); //doesn't work $result = $doc->xpath('//title[text()="site"]'); //doesn't work $result = $doc->xpath('//title[contains(site)]'); //doesn't work $result = $doc->xpath('//title[contains(text(),'Site')]'); //doesn't work foreach ($result as $title) echo "$title<br />"
Tags (comma-separated)
Save Edits
Cancel