We use a page to display dates from the database. Currently it displays a date like this 03157986. When it is displayed on the page I would like to add dashes so the string is formatted like 03-15-1986. How would I do this?
Easy:
$date="03151986";
$year=substr($date,4,4); $month=substr($date,2,2); $day=substr($date,0,2);
print "$day-$month-$year";