Q:

Write a PHP script to convert a date from yyyy-mm-dd to dd-mm-yyyy

0

Write a PHP script to convert a date from yyyy-mm-dd to dd-mm-yyyy.

Sample date : 2012-09-12

Pictorial Presentation:

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

<?php
$odate = "2012-09-12";
$newDate = date("d-m-Y", strtotime($odate));
echo $newDate."\n";
?>

Sample Output:

12-09-2012

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now