Two php date control class instances, php date class instances_PHP tutorial
WBOY
Release: 2016-07-13 10:12:06
Original
1875 people have browsed it
Two php date control class instances, php date class instances
The examples in this article describe two PHP date control classes. Share it with everyone for your reference. The specific analysis is as follows:
Due to work needs, I found two time and date controls. This does not require JS and only needs to be implemented in PHP. Because it requires a reference query operation, interested friends can refer to it. I use the second one myself, so the second one is used. I have made modifications myself.
Example 1, the code is as follows:
Copy code The code is as follows:
<?php
class Calendar
{
var $month;
var $year;
function __construct($year,$month)
{
$this->year=$year;
$this->month=$month;
}
function endday()
{
$daydate=date("d",mktime(0,0,0,$this->month,35,$this->year));
$endday=35-$daydate;
return $endday;
}
function oneday_week()
{
$oneday_week=date("w",mktime(0,0,0,$this->month,1,$this->year));
return $oneday_week;
}
I hope this article will be helpful to everyone’s PHP programming design.
http://www.bkjia.com/PHPjc/924540.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/924540.htmlTechArticleTwo php date control class examples, php date class examples This article describes two php date control classes. Share it with everyone for your reference. The specific analysis is as follows: Due to work needs, I found...
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn