PHP code example of wch / checkworkday

1. Go to this page and download the library: Download wch/checkworkday library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wch / checkworkday example snippets


(new Data)->getday(20200720);
regexp
{
"20190101" : "2"
}
regexp
{
"status": 1,
"type": 1,
"day": "20190728",
"unixtime": 1532707200,
"yearname": "戊戌",
"nonglicn": "六月十六",
"nongli": "6-16",
"shengxiao": "狗",
"jieqi": "大暑后",
"weekcn": "六",
"week1": "Sat",
"week2": "6",
"week3": "Saturday",
"daynum": "208",
"weeknum": "30"
}
regexp
status	0 失败 1 成功
type	0工作日 1 假日 2节日
day	年月日
unixtime	unix时间戳
yearname	农历年
nonglicn	农历月日(中文)
nongli	农历月日
shengxiao	生肖
jieqi	节气
weekcn	星期(中文)
week1	星期(简写)
week2	星期(数字)
week3	星期(英文)
daynum	一年中第几天
weeknum	一年中第几周
regexp
{
"20190101" : "2",
"20190103" : "0",
"20190105" : "0",
"20191201" : "1"
}
返回参数说明

类型	说明
json	具体数据(0,1,2)
regexp
{
"201910" : {
"1001" : "2",
"1002" : "2",
"1003" : "2",
"1004" : "1",
"1005" : "1",
"1006" : "1",
"1007" : "1"
}
}
返回参数说明

类型	说明
json	具体数据(0,1,2)
regexp
{
"2019" : {
"1001" : "2",
"1002" : "2",
"1003" : "2",
"1004" : "1",
"1005" : "1",
"1006" : "1",
"1007" : "1",
"0101" : "2",
"0215" : "1",
"0216" : "2",
"0217" : "2",
"0218" : "2",
"0219" : "1",
"0220" : "1",
"0221" : "1",
"0405" : "2",
"0406" : "1",
"0407" : "1",
"0429" : "1",
"0430" : "1",
"0501" : "2",
"0616" : "1",
"0617" : "1",
"0618" : "2",
"0922" : "1",
"0923" : "1",
"0924" : "2"
}
}
返回参数说明

类型	说明
json	具体数据(0,1,2)
regexp
{
"201901" : {
"0101" : "2"
},
"201902" : {
"0215" : "1",
"0216" : "2",
"0217" : "2",
"0218" : "2",
"0219" : "1",
"0220" : "1",
"0221" : "1"
} } 返回参数说明

类型 说明 json 具体数据(0,1,2)