PHP code example of nil-2008 / phalapi-weekday

1. Go to this page and download the library: Download nil-2008/phalapi-weekday 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/ */

    

nil-2008 / phalapi-weekday example snippets


/**
 * 请在下面放置任何您需要的应用配置
 */

return array(

    'on_holidays_list' => array(
        //中秋
        mktime(0, 0, 0, 9, 24, 2018),
        //国庆
        mktime(0, 0, 0, 10, 1, 2018),
        mktime(0, 0, 0, 10, 2, 2018),
        mktime(0, 0, 0, 10, 3, 2018),
        mktime(0, 0, 0, 10, 4, 2018),
        mktime(0, 0, 0, 10, 5, 2018),
    ),

);


// 惰性加载Weekday
$di->weekday = function () {
    return new \PhalApi\Weekday\Lite(\PhalApi\DI()->config->get("app.on_holidays_list"));
}


echo  \PhalApi\DI()->weekday->isWeekday();