php determines whether the current time is a working day? How to implement
in code? Please give your advice
Thank you very much for your advice, but my demand is working days, not Monday to Friday, except national holidays and weekends
php determines whether the current time is a working day? How to implement
in code? Please give your advice
Thank you very much for your advice, but my demand is working days, not Monday to Friday, except national holidays and weekends
Update according to the problem
take it away.
HolidayApi
=
$time = time();
$w = date('w',$time);
if($w != 0 and $w != 6)
{
echo '';
}
else
{
echo '';
}
weekday Monday, this is the day of the week
getdate()
//
Array (
[seconds] => 55
[minutes] => 9
[hours] => 18
[mday] => 23
[wday] => 1
[mon] => 4
[year] => 2018
[yday] => 112
[weekday] => Monday
[month] => April
[0] => 1524478195
)
"apart from national holidays and weekend working days", sometimes going to work on weekends is a working day, right?
does not know your specific usage scenarios. You can refer to the following. The validity of the code has not been verified, but for reference only
because the national holidays change every year. So use the API interface to determine that it is necessary
https://www.aspirantzhang.com.
I ask the operator to manually enter the annual holiday and then match it
the annual holiday is handed over to the operation and maintenance
$dt = Carbon::now ();
$dt- > isWeekday ();
$dt- > isWeekend ();
http://carbon.nesbot.com/docs/
echo date('w'); //;0,123456
several people upstairs may have misunderstood. The problem of the landlord is not isWeekday (which can be achieved by built-in date library), but to determine whether a certain day is a working day other than a legal holiday. For example, if you develop a program about the stock market, you need to know whether the market will be closed or open one day.
since many legal holidays are man-made and random and unpredictable for the code, I think we must import some hard-coded calendar to judge in advance, or through some third-party api to determine.
PHP can't know when you rest and go to work. To judge your working day, please call a third party API
apijson```
$time = time();
$w = date('w',$time);
. Previous: Questions about vue $root
Next: Could you tell me how to add the red underline when clicking the mouse?
try the events and methods of jqgrid api, are useless, ask the boss what good methods are available ...
recently I was learning jwt, but encountered a problem. the user enters the user name and password and sends it to the server, which encrypts it and returns it to token, with this token for every front-end request. so I have a problem: if the user ent...
for example, for a shopping website, after adding an item to the database through the background, how to generate a page of the product for users to visit? I hope you can help ~ Thank you very much! ...
Please explain in detail if you have the picture, ...
I would like to ask the bosses, is the current Mini Program can jump to the mobile app store? Because I saw the web-view tag, didn t it say that you can open the H5 page in Mini Program, so isn t that the same as the H5 jump? how do you do it if you c...
Student information management needs to be designed in the project. Contains grade, class, students and other information. but there is a problem. The grade of the students changes every year, and the first grade is promoted to the second grade. how ca...
function Test(){ this.func1=function(){ console.log("func1") } this.func2=function(){ console.log("func2") } this.func3=function(){ console.log("func3") } this.all=function...
background: the backend crawls the details pages of other websites. If you want to put them in our mobile phone app and keep the style uniform, you cannot use iframe. But we are not sure about the complexity of this detail page. There may be table, i...
there is such a demand at present: <view wx:for= {{getUserInfo}} wx:key= index wx:for-index= index > <!-- --> <view>{{item.name}}< view> <!-- --> <view>{{setUserName}}< view> < view&...
I found a project on github that I want to introduce locally to see this problem, and I don t have a game.json file for guidance ....
products require this implementation. Is this feasible? Our project is mainly running in Wechat, ...
is currently developing an official account that uses vue s hash mode for vue, routing, but the Android phone will modify my custom link during the test. I will intercept all the addresses after-sharp for example, my custom sharing link is http: e...
requirement description: get a three-dimensional array from PHP, and now you want to get the data through JQ JS. how do I correctly get an array of {$layer} in the page (no need to display)? JQ JS gets the data separately? HTML <volis...
< H1 > html: < H1 > upload multiple images using input, and confirm after selecting multiple images. < H1 > jquery: < H1 > use jquery to obtain the data of the files object in the input node, for example, there are five image files in the acquired...
onCheckForUpdatetrueconsole ...
php is empty ...
< div id= "text " > my Baidu < script type= " text javascript "> var txt = document.getElementById ( text ). InnerHTML; var regexp = (http: |https: )((w|=|?|.| |&|-)+) g; regular match txt1=txt.replace (regexp,function ($url) {) return...
<form action="" method="post"> <select name="Color"> <option value="Red">myRed< option> <option value="Green">myGreen< option> <option value="Blue">myBl...
does this function require front and rear cooperation? Or can it be completed as long as the front end? the requirement is to fill in the project name. Multiple project names automatically appear in the box below. Click on the input box above, and the ...
the local Wechat development tool looks at the interface and returns empty. but the interface can be accessed by scanning the QR code on the phone after compilation, and there is also a value for accessing this path on the browser. Why is this ? ...