Home  >  Article  >  Backend Development  >  How to get quarter based on year and month in php_PHP tutorial

How to get quarter based on year and month in php_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:34:571310browse

Copy code The code is as follows:

function getQuarterByMonth($date){
$ month = substr($date,-2);
$Q = ceil($month/3);
return $Q;
}
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/747679.htmlTechArticleCopy the code as follows: ?php function getQuarterByMonth($date){ $month = substr($date,-2 ); $Q = ceil($month/3); return $Q; } ?...
Statement:
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