Search Results

Search found 2 results on 1 pages for 'user577823'.

Page 1/1 | 1 

  • 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

    Read the article

  • Xpath problem, getting the id(attribute) of a element, if you know the title of the element.

    - by user577823
    Hi guys, My question is, is it possible to get the Article ID, when you have the title of the article?(via xpath) Articles Article ID="1" title crack /title content blablabalbal /content /Article /Articles 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"]; } }

    Read the article

1