-2
我需要在PHP中創建數組XML xmlns的如何從陣列中xmlns的
這裏是我的數組和所需的輸出XML
<?php
$aray= array(
'foo' => '12',
'boo' => '15',
'bar' => 'test value',
);
?>
所需的輸出
<xml version="1.0" encoding="utf-16"?>
<opertaion xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<foo xmlns="http://www.w3schools.com">12</foo>
<boo xmlns="http://www.w3schools.com">15</boo>
<bar xmlns="http://www.w3schools.com">test value</bar>
</opertaion>
PHP創建XML
頁面是否僅XML?那麼你應該使用'header(「Content-type:text/xml」);'高於一切。 –