0

How can I parse this xml, and get url text and title node value seperated:

<root>
  <test>
    <gate>
        <url>http://google.com<title>Google</title></url>
    </gate>
  </test>
</root>

Is this possible with DomDocument or SimpleXML ?

1 Answers1

0

Try with this:

$data = simplexml_load_file("file.xml");
echo $data->root->test->gate->url
Ahmed Ziani
  • 1,206
  • 3
  • 14
  • 26