Home > php教程 > PHP源码 > body text

php短信接口例子

PHP中文网
Release: 2016-05-22 17:22:31
Original
1090 people have browsed it

php代码

<?php
include_once(&#39;sms.php&#39;);

$target = "http://dc.28inter.com/sms.aspx";
//替换成自己的测试账号,参数顺序和wenservice对应
$post_data = "action=send&userid=&account=账号&password=密码&mobile=手机号&sendTime=&content=".rawurlencode("程序调试请测试平时需要发送的内容");
//$binarydata = pack("A", $post_data);
$gets = Post($post_data, $target);
$start=strpos($gets,"<?xml");
$data=substr($gets,$start);
$xml=simplexml_load_string($data);
var_dump(json_decode(json_encode($xml),TRUE));
//请自己解析$gets字符串并实现自己的逻辑
//0表示成功,其它的参考文档
?>
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template