Xpath problem, i have a question about if i can get a elements attribute, if i know what a elements value is.
- by user577823
Hi guys,
This is the xml file, And my question is, is it possible to get the Article ID, when you have the title of the article?(via xpath)
`
crack
jack
`
Because i am using this right now, it isnt working though.
$xml = simplexml_load_file("Articles.xml");
$XElement = new SimpleXMLElement($xml-asXML());
$Articles = $XElement-xpath("Article");
$title = "crack";
$elements = count($Articles);
for($i = 0; $i title;
if($Titles == $title) //This is not working? i dont know why?
{
$AID = (string)$Articles[$i][@"ID"];
}
}
Kind regards,
User577823