Get the date of the next 15th and/or 30th day with php?

Wednesday, November 4, 2015

I require to get the dates of the upcoming 15th and 30ths of the next months as for the current date. (If February is within range it must be 28/29th of course).



Can I do this using mktime/strtotime or maybe using another method?



I got this but of course this is for only get the last day of this and next month. I need the upcoming 15ths and 30ths instead.



$cuota1 = date('t-m-Y', strtotime('+15 days'));
return $cuota1;

$cuota2 = date('t-m-Y', strtotime('+30 days'));
return $cuota2;

$cuota3 = date('t-m-Y', strtotime('+45 days'));
return $cuota3;


Thanks in advance.

0 comments:

Post a Comment