我想知道是否有人知道如何从XML文件获取信息并使用php将其转换为表单选择/列表。这是XML模式:
<?xml version="1.0" encoding="utf-8"?>
<expose version="2.1">
<collection _mngid="1">
<collection _mngid="1">
<title>Heatherton Football Club</title>
<thumb>
<url>albthumbs/albth_1.jpg</url>
</thumb>
<collection _mngid="8">
<title>2009 Season</title>
<thumb>
<url>albthumbs/albth_8.jpg</url>
</thumb>
<album _mngid="2">
<title>Round 17</title>
<contentxmlurl>alb_2.xml</contentxmlurl>
<contentnumber>20</contentnumber>
<thumb>
<url>albthumbs/albth_2.jpg</url>
</thumb>
</album>
</collection>
<album _mngid="3">
<title>Auskick</title>
<contentxmlurl>alb_3.xml</contentxmlurl>
<contentnumber>35</contentnumber>
<thumb>
<url>albthumbs/albth_3.jpg</url>
</thumb>
</album>
</collection>
<collection _mngid="4">
<title>Events Gallery</title>
<thumb>
<url>albthumbs/albth_4.jpg</url>
</thumb>
<album _mngid="5">
<title>80's Night</title>
<contentxmlurl>alb_5.xml</contentxmlurl>
<contentnumber>43</contentnumber>
<thumb>
<url>albthumbs/albth_5.jpg</url>
</thumb>
</album>
</collection>
<collection _mngid="6">
<title>Match Highlights</title>
<thumb>
<url>albthumbs/albth_6.jpg</url>
</thumb>
<album _mngid="7">
<title>Match Highlights</title>
<contentxmlurl>alb_7.xml</contentxmlurl>
<contentnumber>10</contentnumber>
<thumb>
<url>albthumbs/albth_7.jpg</url>
</thumb>
</album>
</collection>
</collection>
</expose>
我需要“contentnumber”编号和“title”来创建这样的表单选择/列表:
<select name="select" id="select">
<option value="20">Round 17</option>
<option value="35">Auskick</option>
<option value="43">80's Night</option>
<option value="10">Match Highlights</option>
</select>
这甚至可能吗?我只需要带有“contentnumber”的(当然它是“标题”)它需要通过php动态提取:)任何人都可以帮助我吗?