当前位置:编程学习 > php >>

NuSOAP 调用 Web Service 出现乱码的解决方法:

研究过 NuSOAP 代码后我们会发现,当 xml_encoding 设置为 UTF-8 时,NuSOAP 会检测 decode_utf8 的设置,如果为 true ,会执行 PHP 里面的 utf8_decode 函数,而 NuSOAP 默认为 true,因此,我们需要设置:

 代码如下 复制代码

$client->soap_defencoding = 'utf-8';
$client->decode_utf8 = false;
$client->xml_encoding = 'utf-8';

补充:Php教程,Php高级应用 
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,