Specify the date in the xpath expression,
i.e.
$nodes = $xml->xpath('//xml/events[@date="14/12/2011"]');
would select only the last events-node in the example
More Related Contents:
- SimpleXML: Selecting Elements Which Have A Certain Attribute Value
- How can I set text value of SimpleXmlElement without using its parent?
- How to convert array to SimpleXML
- Accessing @attribute from SimpleXML
- Remove a child with a specific attribute, in SimpleXML for PHP
- Selecting a css class with xpath
- How to use XMLReader in PHP?
- Forcing a SimpleXML Object to a string, regardless of context
- Parse XML with Namespace using SimpleXML [duplicate]
- PHP namespace simplexml problems
- Error: “Input is not proper UTF-8, indicate encoding !” using PHP’s simplexml_load_string
- SimpleXML and print_r() – why is this empty?
- How to write CDATA using SimpleXmlElement?
- Using SimpleXML to read RSS feed
- PHP SimpleXML: insert node at certain position
- Accessing @attribute from SimpleXML
- ‘xmlParseEntityRef: no name’ warnings while loading xml into a php file
- Updating XML node with PHP
- SimpleXML: Working with XML containing namespaces
- PHP – Processing Invalid XML
- Loop through an XML object with SimpleXML
- Using SimpleXML to create an XML object from scratch
- simplexml error handling php
- PHP SimpleXML Namespace Problem
- PHP, SimpleXML, decoding entities in CDATA
- edit XML with simpleXML
- converting SOAP XML response to a PHP object or array
- Format output of $SimpleXML->asXML(); [duplicate]
- How to save changed SimpleXML object back to file?
- XPath query with PHP