fork download
  1. <?php
  2.  
  3. $hora = '120034';
  4. $data = '20170508';
  5. $mes = '201704';
  6. $fome = '62992161424';
  7.  
  8. $array = str_split($hora, 2);
  9. $string = implode(":", $array);
  10. echo $string;
  11.  
  12. echo "\n";
  13.  
  14. $ano = substr($data, 0, 4);
  15. $mez = substr($data, 4, 2);
  16. $dia = substr($data, 6, 2);
  17. $string = $dia . "/" . $mez . "/" . $ano;
  18. echo $string;
  19.  
  20. echo "\n";
  21.  
  22. $ano = substr($mes, 0, 4);
  23. $month = substr($mes, 4, 2);
  24. $string = $month . "-" . $ano;
  25. echo $string;
  26.  
  27. echo "\n";
  28.  
  29. $dois = substr($fome, 0, 2);
  30. $cinco = substr($fome, 2, 5);
  31. $quatro = substr($fome, 7, 4);
  32.  
  33. $string = $dois . "-" . $cinco . "-" . $quatro;
  34. echo $string;
Success #stdin #stdout 0.02s 23740KB
stdin
Standard input is empty
stdout
12:00:34
08/05/2017
04-2017
62-99216-1424