代码如下:

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