返回首页

中文汉字转拼音全拼或首字

中文汉字转换全拼音或首字母api接口

1627 飞飞免费API接口
接口地址
https://ffapi.cn/int/v1/pinyin
返回格式
json
请求方式
get/post
请求示例
https://ffapi.cn/int/v1/pinyin?info=中国

参数说明

名称 必填 类型 说明
infostring转换的内容
typestring类型,传入1返回首字母2或不传人则返回全拼
formatstring输出格式(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;
?>