25 Star 245 Fork 75

xiaogg / 节假日api

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
index.php 812 Bytes
一键复制 编辑 原始数据 按行查看 历史
<?php
/**
* 精简节假日api
* @copyright tool.bitefu.net
* @auther xiaogg@sina.cn
*/
error_reporting("E_ALL");ini_set("display_errors", 1);
$data=$_REQUEST;
if(empty($data['d'])){
header("content-Type: text/html; charset=utf-8");exit('?d=');
}else{
header("content-Type: application/json; charset=utf-8");
include('include/dateapi.class.php');//创建实例
$api= new dateapi();
$check=$api->check($data['d']);
if($check['status']==0)ajaxReturn($result);//校验日期合法性 可不校验
$result= $api->getday($data['d']);
ajaxReturn($result);
}
function ajaxReturn($array){
$content=json_encode($array,JSON_UNESCAPED_UNICODE);
if(empty($_GET['callback'])){
echo $content;exit;
}else{
echo $_GET['callback']."(".$content.")";exit;
}
}
?>
PHP
1
https://gitee.com/web/holidays_api.git
git@gitee.com:web/holidays_api.git
web
holidays_api
节假日api
master

搜索帮助