Skip to content

Instantly share code, notes, and snippets.

@luizventurote
Created April 16, 2014 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luizventurote/10918339 to your computer and use it in GitHub Desktop.
Save luizventurote/10918339 to your computer and use it in GitHub Desktop.
Get Date array by date.
<?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