Skip to content

Instantly share code, notes, and snippets.

View pierrre's full-sized avatar
🤷‍♂️
¯\_(ツ)_/¯

Pierre Durand pierrre

🤷‍♂️
¯\_(ツ)_/¯
View GitHub Profile
@pierrre
pierrre / gist:5345134
Created April 9, 2013 11:59
Ne jamais coder bourré
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());
}
});