基于php的新华字典接口调用代码实例接口描述:基于php的新华字典接口调用代码实例接口平台:聚合数据<!--?php//+----------------------------------------------------------------------//|JuhePHP[NOZUONODIE]//+----------------------------------------------------------------------//|Copyright(c)2010-2015Allrightsreserved.//+----------------------------------------------------------------------//|Author:Juhedata<info@-->//+---------------------------------------------------------------------- //----------------------------------//新华字典调用示例代码-聚合数据//在线接口文档:s/156//---------------------------------- header('Content-type:text/html;charset=utf-8'); //配置您申请的appkey$appkey="*********************"; //************************$url="http://v./xhzd/query";$params=array( "word"=>"",//填写需要查询的汉字,UTF8urlencode编码 "key"=>$appkey,//应用APPKEY(应用详细页查询) "dtype"=>"",//返回数据的格式,xml或json,默认json);$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"请求失败";}//************************************************** //************************$url="http://v./xhzd/bushou";$params=array( "key"=>$appkey,//应用APPKEY(应用详细页查询) "dtype"=>"",//返回数据的格式,xml或json,默认json);$paramstring=http_build_query($params);$content=juhecu
基于php的新华字典接口调用代码实例 来自淘豆网m.daumloan.com转载请标明出处.