fork download
  1. <?php
  2.  
  3. $datefrom = date('d/m/Y', strtotime($_GET[from]));
  4. $dateto = date('d/m/Y', strtotime($_GET[to]));
  5.  
  6.  
  7. echo $datefrom, '<br>';
  8. echo $dateto, '<br>';
  9.  
  10. date_modify($datefrom, '+20 day');
  11. date_modify($dateto, '+1 day');
  12.  
  13. echo $datefrom, '<br>';
  14. echo $dateto;
Success #stdin #stdout #stderr 0.02s 23564KB
stdin
Standard input is empty
stdout
01/01/1970<br>01/01/1970<br>01/01/1970<br>01/01/1970
stderr
PHP Notice:  Use of undefined constant from - assumed 'from' in /home/mlpI86/prog.php on line 3
PHP Notice:  Undefined index: from in /home/mlpI86/prog.php on line 3
PHP Notice:  Use of undefined constant to - assumed 'to' in /home/mlpI86/prog.php on line 4
PHP Notice:  Undefined index: to in /home/mlpI86/prog.php on line 4
PHP Warning:  date_modify() expects parameter 1 to be DateTime, string given in /home/mlpI86/prog.php on line 10
PHP Warning:  date_modify() expects parameter 1 to be DateTime, string given in /home/mlpI86/prog.php on line 11