actually i have a number that is generated from a database. like $clo_date = 20130405 what i need is to make that number as 2013-04-05
so how can i do it in php
You could format it using the date function
$date = date("Y-m-d",strtotime($clo_date)); echo $date;
Or you could use a regular expression:
preg_match('/(\d{4})(\d{2})(\d{2})/', $clo_date, $matches); $clo_date = implode('-', $matches);
thank you allll