<output id="r87xx"></output>
    1. 
      
      <mark id="r87xx"><thead id="r87xx"><input id="r87xx"></input></thead></mark>
        •   

               當(dāng)前位置:首頁>軟件介紹>基于php的萬年歷接口調(diào)用代碼實例 查詢:
               
          基于php的萬年歷接口調(diào)用代碼實例

                  基于php的萬年歷接口調(diào)用代碼實例 代碼描述:基于php的萬年歷接口調(diào)用代碼實例

                  代碼平臺:聚合數(shù)據(jù)

                  <?php  

                  //----------------------------------

                  // 萬年歷調(diào)用示例代碼 , 聚合數(shù)據(jù)

                  // 在線接口文檔:

                  //----------------------------------

                  header('Content-type:text/html;charset=utf-8' );

                  //配置您申請的appkey

                  $appkey = "*********************";

                  //************1.獲取當(dāng)天的詳細(xì)信息************

                  $url = ";ar/day" ;

                  $params = array(

                  "key" => $appkey,//您申請的appKey

                  "date" => "",//指定日期,格式為YYYY-MM-DD,如月份和日期小于10,則取個位,如:2012-1-1

                  );

                  $paramstring = http_build_query($params );$conten = juhecutrl($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.獲取當(dāng)月近期假期************ $url = ;ar/month" ;$params = array(

                  "key" => $appkey,//您申請的appKey

                  "year-month" => "",//指定月份,格式為YYYY-MM,如月份和日期小于10,則取

                  個位,如:2012-1

                  );

                  $paramstring = http_build_query($params );$conten = juhecutrl($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.獲取當(dāng)年的假期列表************ $url = ";ar/year" ;$params = array(

                  "key" => $appkey,//您申請的appKey

                  "year" => "",//指定年份,格式為YYYY,如:2015 );

                  $paramstring = http_build_query($params );$conten = juhecutrl($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 "請求失敗";

                  }

                  //**************************************************

                  /**

                  * 請求接口返回內(nèi)容

                  * @param string $url [請求的URL地址 ]

                  * @param string $params [請求的參數(shù)]

                  * @param int $ipost [是否采用POST形式 ]

                  * @return string

                  */

                  function juhecurl($url,$params=false,$ispost =0){

                  $httpInfo = array();

                  $ch = curl_init();

                  curl_setopt( $ch, CURLOPT_HTTP_VERSION , CURL_HTTP_VERSION_ 1_1 );

                  curl_setopt( $ch, CURLOPT_USERAGENT , 'JuheDa ); ta'

                  curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT , 60 );

                  curl_setopt( $ch, CURLOPT_TIMEOUT , 60);

                  curl_setopt( $ch, CURLOPT_RETURNTRANSFER , true );

                  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

                  if( $ispost )

                  {

                  curl_setopt( $ch , CURLOPT_POST , true );

                  curl_setopt( $ch , CURLOPT_POSTFIELDS , $params );

                  curl_setopt( $ch , CURLOPT_URL , $url );

                  }

                  else

                  {

                  if($params){

                  curl_setopt( $ch , CURLOPT_URL , $url.'?'.$params );

                  }else{

                  curl_setopt( $ch , CURLOPT_URL , $url);

                  }

                  }

                  $response = curl_exec( $ch );

                  if ($response === FALSE) {

                  //echo "cURL Error: " . curl_error($ch);

                  return false;

                  }

                  $httpCode = curl_getinfo( $ch, CURLINFO_HTTP_CODE  );

                  $httpInfo = array_merge( $httpIn , curl_gfoetinfo( $ch) );

                  curl_close( $ch );

                  return $response ;

                  }

                  


          PHP平臺的缺陷如何成為PHP高手
          PHP入門學(xué)習(xí)基礎(chǔ)教程php主動加載
          PHP提高編程效率的方法 php基礎(chǔ)知識點總結(jié)
          PHP從零入門教程PHP內(nèi)核解密
          學(xué)習(xí)PHP的方法與技巧PHP7性能翻倍關(guān)鍵大揭秘
          如何遏制PHP木馬攻擊PHP編程教程Ajax完成分頁技巧
          MySQL讀寫分離由PHP實現(xiàn)談PHP生成靜態(tài)頁面
          PHP訪問MySQLPHP常用代碼
          信息發(fā)布:廣州名易軟件有限公司 http://www.jetlc.com
          • 勁爆價:
            不限功能
            不限用戶
            1998元/年

          • 微信客服

            <output id="r87xx"></output>
          1. 
            
            <mark id="r87xx"><thead id="r87xx"><input id="r87xx"></input></thead></mark>
              • 高清一区二区三区日本久 | 国产色婷婷久久 | 日韩A片视频免费看 | 狠狠操五月天 | 国产三级三级在线观看 | 欧美三级片在线观看的 | 大香蕉这里只有精品 | 艹逼中文字幕 | 亚洲综合视频在线观看 | 欧美成人精品无码 网站 |