PHP实现手机归属地查询API接口实现代码
2012-08-27 00:00
555 查看
<?php header(“Content-Type:text/html;charset=utf-8″); if (isset($_GET['number'])) { $url = ‘http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx/getMobileCodeInfo'; $number = $_GET['number']; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, “mobileCode={$number}&userId=”); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $data = curl_exec($ch); curl_close($ch); $data = simplexml_load_string($data); if (strpos($data, ‘http://')) { echo ‘手机号码格式错误!'; } else { echo $data; } } ?> <form action=”mobile.php” method=”get”> 手机号码: <input type=”text” name=”number” /> <input type=”submit” value=”提交” /> </form>
相关文章推荐
- PHP实现手机归属地查询API接口
- PHP实现手机归属地查询API接口
- 用PHP实现手机归属地查询api接口
- PHP实现手机归属地查询API接口
- PHP实现手机归属地查询API接口
- 用PHP实现手机归属地查询api接口
- php登录验证及代码实现 含数据库设计 亲測有效
- php文字水印和php图片水印实现代码
- php模拟socket一次连接,多次发送数据的实现代码
- 解读PHP计算页面执行时间的具体代码实现
- 代码实现PHP web服务器下绝对路径到Web网址的转换
- 【实战代码】PHP实现读取一个1G的文件大小
- PHP读取网页文件内容的实现代码(fopen,curl等)
- 纯PHP代码实现支付宝批量付款
- PHP中遍历stdclass object的实现代码
- php 生成静态页面的办法与实现代码详细版
- php中转义mysql语句的实现代码
- 后台登录(包含验证码)的php代码实现