Sort a multi-dimensional field

function orderBy($data, $field) {
	$code = "return strnatcmp($a['$field'], $b['$field']);";
	usort($data, create_function('$a,$b', $code));
	return $data;
}

source

Comments are closed.