Cup*_*ups 25 php xml encoding simplexml
关于我如何通过以下方式启动PHPs SimplXMLElement的任何想法?
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
Run Code Online (Sandbox Code Playgroud)
然后主根将是:
<Document></Document>
Run Code Online (Sandbox Code Playgroud)
或者我使用simplexml_load_string()来设置它?
上下文:我正在扩展simpleXmlElement来创建一些kml文件.
编辑
实际上,设置kml xmlns很容易做到:
new simpleXMLElement('<kml xmlns="http://earth.google.com/kml/2.2">
<Document></Document></kml>');
Run Code Online (Sandbox Code Playgroud)
如何设置编码="UTF-8"困扰我,似乎没有它可以接受kml,但我仍然想知道如果pos这样做怎么做.
OZ_*_*OZ_ 51
new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?>'
.'<kml xmlns="http://earth.google.com/kml/2.2">'
.'<Document></Document></kml>');
Run Code Online (Sandbox Code Playgroud)