|
-
xml displaying id in html? help
ih im pretty new to xml so it maybe simple to answer if i have an xml file as follows
<bets>
<comp>
<name id='1234'>Matt</name>
<price>12/3</price>
</comp>
<comp>
<name id='1233'>Nick</name>
<price>170/3</price>
</comp>
<comp>
<name id='1232'>Dan</name>
<price>199/1</price>
</comp>
</bets>
is there anyway of didplaying the id aswel??
im using this to display the names and price
------------------------------------
<?php
$xml = simplexml_load_file('betting.xml');
foreach ($xml->comp as $comp) {
echo $comp->name.' '.$comp->price.'<br>';
}
?>
-----------------------------------
cheers matt
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
|
Bookmarks