我需要使用PHP(即名稱,電話1,電話2)更改xml屬性。已更改的屬性值需要保存到代碼從其中獲取的文件中。 任何人都可以讓我走上正軌嗎?如何設置xml屬性並將更改保存到文件?
<PhoneBook>
<Title>TRSA</Title>
<Menu Name="Informational">
<Unit Name="Name Surname" Phone1="476" Phone2="8 888 88 888"
Phone3="62811" default_photo="Resource:"/>
<Unit Name="John Johnson" Phone1="412" Phone2="" Phone3="62812"
default_photo="Resource:"/>
<Unit Name="Carl Johnson" Phone1="481" Phone2="8 888 88 888"
Phone3="22222" default_photo="Resource:"/>
<Unit Name="Carl Johnson" Phone1="481" Phone2="" Phone3="22222"
default_photo="Resource:"/>
<Unit Name="Carl Johnson" Phone1="427" Phone2="" Phone3="22222"
default_photo="Resource:"/>
<Unit Name="Carl Johnson" Phone1="414" Phone2="" Phone3="22222"
default_photo="Resource:"/>
<Unit Name="Carl Johnson" Phone1="414" Phone2="8 888 88 888"
Phone3="22222" default_photo="Resource:"/>
<Unit Name="Carl Johnson" Phone1="410" Phone2="8 888 88 888"
Phone3="22222" default_photo="Resource:"/>
</Menu>
<Menu Name="Administration">
<Unit Name="Carl Johnson" Phone1="413" Phone2="8 888 88 888"
Phone3="22222" default_photo="Resource:"/>
<Unit Name="Carl Johnson" Phone1="450" Phone2="8 888 88 888"
Phone3="22222" default_photo="Resource:"/>
<Unit Name="Carl Johnson" Phone1="344" Phone2="8 888 88 888"
Phone3="22222" default_photo="Resource:"/>
<Unit Name="Carl Johnson" Phone1="484" Phone2="" Phone3="52110"
default_photo="Resource:"/>
<Unit Name="Carl Johnson" Phone1="465" Phone2="8 888 88 888"
Phone3="22222" default_photo="Resource:"/>
<Unit Name="Carl Johnson " Phone1="522" Phone2="8 888 88 888"
Phone3="22222" default_photo="Resource:"/>
</Menu>
</PhoneBook>
可能的重複[你如何解析和處理PHP中的HTML/XML?](https://stackoverflow.com/questions/3577641/how-do-you-parse-and-process-html-xml-in -php) –