Xmlreader attribute info

I am trying to read a large XML file and add it to a database.
Here is a very small example of the XML:

<?xml version="1.0" encoding="UTF-8"?>
   <show id="33041">
       <title>The Sound of Music</title>
       <price currency="GBP">

The problem is that I do not know how to refer to the id value in <show id=“33041”>

Here is a snippet of code I am using:

    $xml = new XMLReader();
    while ($xml->read()) {
	        switch ($xml->name) {
			case "event":
            $conf["event"] = $xml->value;

I have no problem in actually INSERTing into my db but how do I get the ID bit in value in <show id=“33041”> into an array or string??

Thanks for any help.

The php.net documentation for XMLReader specifies a method called getAttribute(), you should be able to use it like the below example.


Thanks very much, that pointed me in the right direction.
I did have to remove a read line. But you helped with the getattribute.