I need to convert the date format to mm-dd-yyyyI don’t know which format of the current date is dynamic, so if I have a dynamic date format already in mm-dd-yyyy, then the function date()returns below outout
$date='02-13-2011';
echo date('m-d-Y',strtotime($date));
conclusion
01-01-1970
?>
http://codepad.org/AFZ6jel7
So I need to check if the date is already in mm-dd-yyyy, and then not apply date formatting. Is there any other way to do this? another parameter in these functions or something similar can be passed.
Thank.
source
share