I have some string like this.
$str = '14032017';
I want convert it to date format and show the result as 14-03-2017
I already try this but still didn't work :
<?php
$str = '14032017';
$strdate = strtotime($str);
$date = date('d-m-Y',$strdate);
echo $date;
?>
How could I to do that ?