参数名称 | 类型 | 必填 | 说明 |
---|
参数名称 | 类型 | 说明 |
---|---|---|
chapterid | int | 章节ID |
chaptername | string | 章节名称 |
parentid | int | 上级ID |
detailid | int | 详情ID |
name | string | 名称 |
<?php require_once 'curl.func.php'; $appkey = 'your_appkey_here';//你的appkey $url = "https://api.jisuapi.com/houhanshu/chapter?appkey=$appkey"; $result = curlOpen($url, ['ssl'=>true]); $jsonarr = json_decode($result, true); //exit(var_dump($jsonarr)); if($jsonarr['status'] != 0) { echo $jsonarr['msg']; exit(); } $result = $jsonarr['result']; foreach($result as $val) { echo $val['chapterid'].' '.$val['chaptername'].' '.$val['parentid'].'
'; if(is_array($val['list'])) { foreach($val['list'] as $k=>$v) { echo $v['detailid'].' '.$v['name'].'
'; } } }
{ "status": 0, "msg": "ok", "result": [ { "chapterid": "1", "chaptername": "本纪", "parentid": "0", "list": [ { "detailid": "1", "name": "光武帝纪上" }, { "detailid": "2", "name": "光武帝纪下" }, { "detailid": "3", "name": "显宗孝明帝纪" }, { "detailid": "4", "name": "肃宗孝章帝纪" }, { "detailid": "5", "name": "孝和孝殇帝纪" }, { "detailid": "6", "name": "孝安帝纪" }, { "detailid": "7", "name": "孝顺孝冲孝质帝纪" } ] } ] }
代号 | 说明 |
---|---|
201 | 关键词为空 |
202 | 详情ID为空 |
203 | 没有信息 |
代号 | 说明 |
---|---|
101 | APPKEY为空或不存在 |
102 | APPKEY已过期 |
103 | APPKEY无请求此数据权限 |
104 | 请求超过次数限制 |
105 | IP被禁止 |
106 | IP请求超过限制 |
107 | 接口维护中 |
108 | 接口已停用 |