xpath
Run an XPath query on XML data.
xpath()
function runs an XPath query on an XML document.
Run an XPath query on an XML document:
<?php $note = <<< XML <note> <to>George</to> <from>John</from> <heading>Reminder</heading> <body>Do not forget the meeting!</body> </note> XML ; $xml = new SimpleXMLElement ( $note ) ; $result = $xml -> xpath ( "/note/to" ) ; print_r ( $result ) ; ?>
Run the instance
SimpleXMLElement :: xpath ( path )
parameter | describe |
---|---|
path | Required. Specifies the XPath path to use. |