维宏源码_维宏代码
2024-11-23 08:34
1.PHP调用Http短信接口(返回值为xml),短短信在PHP中如何提取出来里面的值?
PHP调用Http短信接口(返回值为xml),在PHP中如何提取出来里面的值?
使用 simplexml_load_string函数就可以了,例子程序代码:
<?送源防欧模网素材下载源码php
$string = <<<XML
<?xml version="1.0" encoding="utf-8" ?>
<returnsms>
<returnstatus>status</returnstatus>
<message>message</message>
</returnsms>
XML;
$xml = simplexml_load_string($string);
echo 'returnstatus:',$xml->returnstatus,"\n";
echo 'message:',$xml->message,"\n";
print_r($xml);
>2024-11-23 09:00
2024-11-23 08:35
2024-11-23 08:16
2024-11-23 08:16
2024-11-23 07:16
2024-11-23 06:41
2024-11-23 06:40
2024-11-23 06:29