0
我需要用用戶提供的值更新xml節點;但我似乎無法修改simplexml對象。有任何想法嗎?如何在php simplexml中修改元素?
XML結構:
<xm>
<unit>
<building></building>
</unit>
<unit>
<building></building>
</unit>
<unit>
<building></building>
</unit>
<unit>
<building></building>
</unit>
</xm>
,我試圖做到這一點,如:
$original_xml = @simplexml_load_file("../test.xml");
$original_xml[$_POST['row_id']-1]->building = $_POST['building_txt'];