Get last day of month


/ Published in: PHP
Save to your folder(s)

Easy way to get the last day of a month in PHP.


Copy this code and paste it in your HTML
  1. <?php
  2.  
  3. // Last day of current month
  4. echo date('t');
  5.  
  6. // Last day of specified month
  7. date('m/t/Y', mktime(0, 0, 0, 6, 1, 2012));
  8.  
  9. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.