我在php中生成以下xml。
PHP代码: -
header("Content-type: text/xml");
echo "<?xml version='1.0' encoding='UTF-8'?>";
echo "<Response>";
echo "<Dial>";
echo $client_no;
echo "</Dial>";
echo "<Say>The call failed or the remote party hung up. Goodbye.</Say>";
echo "</Response>";
输出: -
<Response>
<Dial>919880022477</Dial>
<Say>
The call failed or the remote party hung up. Goodbye.
</Say>
</Response>
现在我想将属性添加到Dial节点。 类似的东西: -
<Dial callerId="jitu">919880022477</Dial>
答案 0 :(得分:1)
试试这个
echo "<Dial callerID='jitu'>";