如何降序排序,使用带有 entity_load 的natcasesort作为基于uid的realname / name?
$users = entity_load('user');
foreach ($users as $uid => $account) {
if ($uid && !in_array($uid, $exclude)) {
$form['massadd']['#options'][$account->uid] = $account->realname;
}
}
答案 0 :(得分:0)
很抱歉刚想通了,问题是我试图反对$ users而不是$ form:)
natcasesort($form['massadd']['#options']);