Created
April 9, 2013 11:59
-
-
Save pierrre/5345134 to your computer and use it in GitHub Desktop.
Ne jamais coder bourré
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
usort($objects, function($a, $b){ | |
$a1 = $a->getName(); | |
$b1 = $b->getName(); | |
if ($a1 == $b1) { | |
return strnatcmp($a1, $b1); | |
} else { | |
return strnatcmp($a->getName(), $b->getName()); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment