Artificial intelligent assistant

DOMのsetAttribute()メソッドに属性を2つ加えたい! PHPXML <?xml version="1.0" encoding="utf-8"?> <root> <MarkerData> <marker lat="35.507456" lng="139.61758499999996"> <icon>atlas</icon> < content ><![CDATA[ <p></p> ]]></content> </marker> </MarkerData> </root> setAttribute()2 !! // $dom = new DomDocument('1.0', 'UTF-8'); // prefs $root = $dom->appendChild($dom->createElement('root')); $MarkerData = $root->appendChild($dom->createElement('MarkerData')); $marker = $MarkerData->appendChild($dom->createElement('marker')); // code $marker->setAttribute(''); // $marker->appendChild($dom->createElement('icon', 'atlas')); $marker->appendChild($dom->createElement('content', '<![CDATA[ <p></p> ]]>')); //XML $dom->formatOutput = true; // $dom->save('prefs.xml');

`setAttribute()`


$marker->setAttribute('lat', '35.507456');
$marker->setAttribute('lng', '139.61758499999996');




PHP: DOMDocument - Manual

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy e8cc4309176f64099825b1123f5e403e