fork(2) download
  1. <?php
  2.  
  3. function returnDates($parcelas, $ultima_data){
  4. for ($i = 1; $i <= $parcelas; $i++){
  5. $date = strtotime("+$i month", strtotime($ultima_data));
  6. echo date("Y-m-t", $date)."\n";
  7. }
  8. }
  9.  
  10. echo returnDates(12,"2007-02-12");
Success #stdin #stdout 0.01s 52488KB
stdin
Standard input is empty
stdout
2007-03-31
2007-04-30
2007-05-31
2007-06-30
2007-07-31
2007-08-31
2007-09-30
2007-10-31
2007-11-30
2007-12-31
2008-01-31
2008-02-29