基于php的笑话大全接口调用代码实例.docVIP

  • 4
  • 0
  • 约3.7千字
  • 约 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/121 //---------------------------------- ? header(Content-type:text/html;charset=utf-8); ? ? //配置您申请的appkey $appkey = *********************; ? ? ? ? //************1.返回接口类型************ $url = /funny/type.from; $params = array( ??????key = $appkey,//您申请的key ); $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 = /funny/list.from; $params = array( ??????cat = ,//指定接口类型,默认1 ??????st = ,//指定开始数,默认0 ??????count = ,//指定返回个数,默认1 ??????key = $appkey,//您申请的key ); $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 = /funny/search.from; $params = array( ??????st = ,//指定开始数,默认0 ??????count = ,//指定返回数量,默认1 ??????term = ,//指定搜索关键词 ??????key = $appkey,//您申请的key ); $paramstring = http_build_query($params); $content = juhecurl($url,$paramstring); $result = json_decode($content,true); if($

文档评论(0)

1亿VIP精品文档

相关文档