Skip to content

Instantly share code, notes, and snippets.

View sharaz-wpbrigade's full-sized avatar

sharaz-wpbrigade

View GitHub Profile
@bcole808
bcole808 / arrSortObjsByKey.php
Created March 5, 2014 17:20
Sort a multi-domensional PHP array of objects by key value
<?php
/**
* Sort a multi-domensional array of objects by key value
* Usage: usort($array, arrSortObjsByKey('VALUE_TO_SORT_BY'));
* Expects an array of objects.
*
* @param String $key The name of the parameter to sort by
* @param String $order the sort order
* @return A function to compare using usort
*/