how to get the number of days of the current month? in PHP

后端 未结 11 1927
悲哀的现实
悲哀的现实 2021-02-12 03:35

i want to check if today is the last day of the month, but i don\'t really know how. i want to write it in php.

can you help?

thanks, Sebastian

11条回答
  •  無奈伤痛
    2021-02-12 04:11

    Using the modern DateTime object class:

    $date = new DateTime('last day of this month');
    

提交回复
热议问题