function getBalance($mobile) {
$API_KEY = '5645226545SD6F';// 控制台密钥
$API_URL = 'https://www.acbapi.com/api/huafei';// 接口地址
$sk = '12345674898897489789498';// 32位自定义
// 判断号码所属运营商
$yd = array("134", "135", "136", "137", "138", "139", "144", "147", "148", "150", "151", "152", "157", "158", "159", "165", "170", "172", "178", "182", "183", "184", "187", "188", "195", "198");
$lt = array("130", "131", "132", "155", "156", "166", "175", "176", "185", "186");
$dx = array("133", "149", "153", "173", "177", "180", "181", "189", "190", "191", "193", "199");
$isp = "";
$yys = "";
$prefix = substr($mobile, 0, 3);
if (in_array($prefix, $yd)) {
$isp = 'yd';
$yys = '中国移动';
} else if (in_array($prefix, $lt)) {
$isp = 'lt';
$yys = '中国联通';
} else if (in_array($prefix, $dx)) {
$isp = 'dx';
$yys = '中国电信';
} else {
// handle error here if prefix does not ma
PHP查询移动、联通、电信话费余额函数示例
于 2024-01-23 16:14:54 首次发布
这篇内容补充了PHP如何识别并查询移动、联通、电信话费余额的函数示例,强调了本地识别运营商号段可能存在的问题,即运营商更新可能导致查询失败。

最低0.47元/天 解锁文章
2577

被折叠的 条评论
为什么被折叠?



