Created
May 30, 2014 19:32
-
-
Save fran6co/a8b924f3500aad90a4bc to your computer and use it in GitHub Desktop.
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 | |
$gatos = array( | |
array( | |
"id" => 1, | |
"name" => "Titus", | |
"fecha" => new \DateTime(), | |
), | |
array( | |
"id" => 2, | |
"name" => "Gato", | |
"fecha" => new \DateTime(), | |
), | |
); | |
usort($gatos, function($gato1,$gato2){ | |
return strcmp($gato1["fecha"]->format("md"),$gato2["fecha"]->format("md")); | |
}); | |
var_dump($gatos); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment