Güncelleme DOM PHP kullanırken XML satır encyption (& # 13) Kaçış

0 Cevap php

I tried to update xml node value by posted PHP value. My problem, after save the XML, can look like

<name>test&#13;
test123</name>

Sonuç beklemek benim

<name>test
test123</name>

Benim kaynak

$xml_Document = new DOMDocument();
$xml_Document->load('test.xml');

$employees = $xml_Document->getElementsByTagName("employees");

foreach( $employees as $employee )
{
$names = $employee->getElementsByTagName("name");

$names->item(0)->nodeValue = $_POST["text1"];

}

$xml_Document->save('test.xml');

Bazı öneri / çözümler verin

0 Cevap