# Xml to php parsing - how to get attribute info? (Not PHP 5)

**URL:** <https://forum.kirupa.com/t/xml-to-php-parsing-how-to-get-attribute-info-not-php-5/250338>\
**Category:** Uncategorized\
**Created:** [January 28, 2008, 5:38pm UTC](https://forum.kirupa.com/t/xml-to-php-parsing-how-to-get-attribute-info-not-php-5/250338 "2008-01-28T17:38:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![farnott](https://avatars.discourse-cdn.com/v4/letter/f/eb8c5e/32.png) [@farnott](https://forum.kirupa.com/u/farnott)\
**Post date:** [January 28, 2008, 5:38pm UTC](https://forum.kirupa.com/t/xml-to-php-parsing-how-to-get-attribute-info-not-php-5/250338/1 "2008-01-28T17:38:40Z")

</div>

Hi guys! I’ve found a really useful tutorial ([http://www.kirupa.com/web/xml\_php\_parse\_intermediate.htm](http://www.kirupa.com/web/xml_php_parse_intermediate.htm)) on the kirupa site that has helped me out of a tight spot … almost!

I’m working on a server that is **NOT** php 5 and will not be for several weeks, so simpleXML is not a solution!a

I’m parsing an XML file in order to build an sql insert statement (xml is the ONLY format I can get hold of the data, as supplied by client)

in .xml file …

\<Property\>  
\<Refnumber\>13\</Refnumber\>  
\<Postcode\>DE223XK\</Refnumber\>  
\<Rent Per=“Month”\>450.00\</Rent\>

I’m using the code from the tutorial mentioned above …

I can access the data from the ‘refnumber’ and ‘postcode’ but I don’t know how to find out what the value is in the Per="" attribute 😑

this is the last part of my code from the tutorial:

echo “rentper:” . $property\_array[$x]-\>rentper . "\<br /\>  
";

could anyone PLEASE help me ??? 🙂

thanks!!!
