接口地址
https://ffapi.cn/int/v1/pinyin
返回格式
json
请求方式
get/post
请求示例
https://ffapi.cn/int/v1/pinyin?info=中国
参数说明
| 名称 | 必填 | 类型 | 说明 |
|---|---|---|---|
| info | 是 | string | 转换的内容 |
| type | 是 | string | 类型,传入1返回首字母2或不传人则返回全拼 |
| format | 是 | string | 输出格式(json、text) |
返回数据
{"code":1,"msg":"获取成功","info":"中国","data":"zhongguo"}
示例代码
<?php
header("Content-Type:text/json;charset=UTF-8");
$info= $_GET["info"];
$url = "https://ffapi.cn/int/v1/pinyin?info=" . $info;
$data = file_get_contents($url);
echo $data;
?>