<?php $str="20181107"; $data = date("Y-m-d", strtotime($str)); echo $data;
Standard input is empty
2018-11-07
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!