public static function getQuarter($month = null)
    {
        if ($month === null) {
            $month = date('n', abs(time()));
        }

        if (in_array($month, range(1, 3))) {
            return 1;
        }

        if (in_array($month, range(4, 6))) {
            return 2;
        }

        if (in_array($month, range(7, 9))) {
            return 3;
        }

        if (in_array($month, range(10, 12))) {
            return 4;
        }
    }
public static function getQuarter($month = null)
    {
        if ($month === null) {
            $month = date('n', abs(time()));
        }

        if (in_array($month, range(1, 3))) {
            return 1;
        }

        if (in_array($month, range(4, 6))) {
            return 2;
        }

        if (in_array($month, range(7, 9))) {
            return 3;
        }

        if (in_array($month, range(10, 12))) {
            return 4;
        }
    }
public static function getQuarter ( $ month = null ) { if ( $ month === null ) { $ month = date ( 'n' , abs ( time ( ) ) ) ; } if ( in_array ( $ month , range ( 1 , 3 ) ) ) { return 1 ; } if ( in_array ( $ month , range ( 4 , 6 ) ) ) { return 2 ; } if ( in_array ( $ month , range ( 7 , 9 ) ) ) { return 3 ; } if ( in_array ( $ month , range ( 10 , 12 ) ) ) { return 4 ; } }
Returns current quarter

@param integer $month Month number without leading zeros
@return integer
Returns current quarter