@since: BuddyPress 2.7.0 Added $preserve_keys parameter.
Description
bp_sort_by_key()

Sort an array of objects or arrays by a specific key/property.

Source: bp-core/bp-core-functions.php:118