繁体   English   中英

使用 php 编辑我的 xml 文件

[英]Edit my xml file using php

我想更新拨号标签并将+923455252632替换为+923333578357这里是代码;

<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Say voice="alice">Thanks for the call. Configure your number's voice U R L to change this message.</Say>
    <Pause length="1"/>
    <Say voice="alice">Let us know if we can help you in any way during your development. you are a good person </Say>
    <Dial>+923455252632</Dial>
</Response>

我找到了解决方案,在这里。

$myfile = fopen("message.xml", "w") or die("Unable to open file!");// opens file in write mode @ftruncate($myfile, 0);// trancate previous contant in the xml file named message $txt = '<?xml version="1.0" encoding="UTF-8"?> <Response> <Say voice="alice"> Your call is being transferred to one of our company employees</Say> <Pause length="1"/> <Say voice="alice"> Please wait.</Say> <Pause length="1"/> <Say voice="alice"> Please wait.</Say> <Say voice="alice">Let us know if we can help you. you are a good person </Say> <Dial>'.$employee.'</Dial> </Response>'; fwrite($myfile, $txt);// Write contant in the file fclose($myfile);// Close file

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM