2014-01-23 2 views
-1

나는 PHP에서 다음 xml을 생성합니다.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 callerId="jitu">919880022477</Dial> 
+0

당신이 스스로를 알아내는으로 어떤 노력을 했습니까 시도? –

답변

1

는이

echo "<Dial callerID='jitu'>"; 
관련 문제