Created
April 16, 2014 18:36
-
-
Save luizventurote/10918339 to your computer and use it in GitHub Desktop.
Get Date array by date.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get Date array by date | |
* | |
* @param string $myDate Date in the format format dd/mm/yyyy | |
* @return array Date array | |
*/ | |
function getDateArray($myDate) { | |
$myDate = explode('/', $myDate); | |
$myDate = $myDate[2].'-'.$myDate[0].'-'.$myDate[1]; | |
$newDate['day'] = date('d', strtotime($myDate)); | |
$newDate['month'] = date('M', strtotime($myDate)); | |
$newDate['year'] = date('y', strtotime($myDate)); | |
return $newDate; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment