I am using SimpleXML to get an element of an XML object specified by tag name and attribute... as follows:
$result = $xml->xpath('Stat[@Type="Venue"]');
$venue = $result[0];
This works fine.
However... the following shortening gives me an error
$venue = $xml->xpath('Stat[@Type="Venue"]')[0];
PHP Parse error: syntax error, unexpected '[' in /var/www/handler.php on line 10
I've got to be being stupid.... but I cannot seem to figure this out.