API接口源码
<?php
$url="https://weixin.10010js.com/app/charge/qryRealFee";
$data='{"phone":'.'"'.$_GET["phone"].'"}';
echo "您的帐户余额是:<font color=red size=30>".(curl_post($url,$data)/100)."</font>元人民币";
function curl_post($url,$data){
$headers = array(
"Host:weixin.10010js.com",
"Content-Type:application/json",
"Cache-Control:no-cache",
"Content-Length:23",
"Accept:*/*",
"Referer:https://weixin.10010js.com/actPage/activity/index28.html?",
"Accept-Language:zh-cn",
"User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36"
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$output = curl_exec($ch);
curl_close($ch);
return $output;
}
?>使用方法
保存以上代码到chf.php,上传PHP环境,浏览器服务:域名/chf.php?phone=手机号码
相关专题
API数据接口
2022-11-010API是开发中必不可少的知识点。API的合理应用可以大大节约开发成本。它收集了关于API接口的信息,包括API接口、API代码和API源代码,帮助你更快地学习和使用API技术。
- 网站Ping接口源码,IP地址+测速[2022-11-17]
- 使用谷歌翻译API接口来制作伪原创的API接口源码-(制作伪原创接口)[2022-11-17]
- ICP备案信息查询API接口[2022-11-03]
- php联通查话费API接口源码[2022-11-03]

