基于php的鬼马问答接口调用代码实例.docVIP

  • 1
  • 0
  • 约3.16千字
  • 约 4页
  • 2017-06-12 发布于北京
  • 举报

基于php的鬼马问答接口调用代码实例.doc

基于php的鬼马问答接口调用代码实例 代码描述:基于php的笑话大全接口调用代码实例 代码平台:聚合数据 !--?php // +---------------------------------------------------------------------- // | JuhePHP [ NO ZUO NO DIE ] // +---------------------------------------------------------------------- // | Copyright (c) 2010-2015 All rights reserved. // +---------------------------------------------------------------------- // | Author: Juhedata info@-- // +---------------------------------------------------------------------- ? //---------------------------------- // 鬼马问答调用示例代码 - 聚合数据 // 在线接口文档:/docs/122 //---------------------------------- ? header(Content-type:text/html;charset=utf-8); ? ? //配置您申请的appkey $appkey = *********************; ? ? ? ? //************1.接口类型查询************ $url = /askanswer/getTypes; $params = array( ??????key = $appkey,//应用APPKEY ); $paramstring = http_build_query($params); $content = juhecurl($url,$paramstring); $result = json_decode($content,true); if($result){ ????if($result[error_code]==0){ ????????print_r($result); ????}else{ ????????echo $result[error_code].:.$result[reason]; ????} }else{ ????echo 请求失败; } //************************************************** ? ? ? ? //************2.接口数据查询************ $url = /askanswer/getCat; $params = array( ??????key = $appkey,//APP Key ??????cat = ,//接口类型序号,默认为1(脑筋急转弯) ??????start = ,//起始位置,默认为0 ??????count = ,//返回条数,默认为20 ); $paramstring = http_build_query($params); $content = juhecurl($url,$paramstring); $result = json_decode($content,true); if($result){ ????if($result[error_code]==0){ ????????print_r($result); ????}else{ ????????echo $result[error_code].:.$result[reason]; ????} }else{ ????echo 请求失败; } //************************************************** ? ? ? ? //************3.接口答案查询************ $url = /askanswer/answer; $params = array( ??????key = $appkey,//APP Key ??????id = ,//题目id ); $paramstring = http_build_query($params); $content = juhecurl($url,$paramstring); $result = json_decode($content,true); if($result){ ????if($result[error_code]==0){ ???

文档评论(0)

1亿VIP精品文档

相关文档