用户登录
用户注册

分享至

php怎么实现字符转电码

  • 作者: 探戈119
  • 来源: 51数据库
  • 2022-10-27

php实现字符转电码的方法:1、注册开通标准电码查询API接口;2、根据“http://v.juhe.cn/telecode/to_telecodes.php?chars=%e8%81%9a%e5%90%88%e6%95%b0%e6%8d%ae&key= xxx key”方式请求数据;3、根据传入的字符返回标准电码即可。

本教程操作环境:windows7系统、PHP8.1版、Dell G3电脑。

php怎么实现字符转电码?

开通标准电码查询API接口:

通过https://www.juhe.cn/docs/api/id/211?s=cpphpcn注册及开通

接口说明:该接口提供的标准中文电码查询程序结果。

返回格式:json

请求方式:get post

请求示例:http://v.juhe.cn/telecode/to_telecodes.php?chars=%e8%81%9a%e5%90%88%e6%95%b0%e6%8d%ae&key=您申请的key

接口备注:根据传入的字符返回标准电码

JSON 返回示例:

{
    "reason": "success",
    "result": {
        "telecodes": "5112 0678 2422 2207"    },
    "error_code": 0
 }
软件
前端设计
程序设计
Java相关