fork download
  1. <?php
  2.  
  3. $data = DateTime::createFromFormat('dmY', '11092018');
  4.  
  5. $formatada = $data->format('d-m-Y');
  6.  
  7. var_dump($formatada);
Success #stdin #stdout 0.01s 82624KB
stdin
Standard input is empty
stdout
string(10) "11-09-2018"