ldap_sort
(PHP 4 >= 4.2.0, PHP 5)
ldap_sort — LDAP 結果エントリをソートする
説明
bool ldap_sort
( resource
$link
, resource $result
, string $sortfilter
)ldap_search() が返す LDAP 検索結果をソートします。
パラメータ
-
link -
ldap_connect() が返す LDAP リンク ID。
-
result -
ldap_search() が返す検索結果 ID。
-
sortfilter -
ソートのキーとして使う属性。
例
検索結果をソートします。
例1 LDAP のソート
<?php
// $ds は有効なリンク ID です (ldap_connect を参照)
$dn = 'ou=example,dc=org';
$filter = '(|(sn=Doe*)(givenname=John*))';
$justthese = array('ou', 'sn', 'givenname', 'mail');
$sr = ldap_search($ds, $dn, $filter, $justthese);
// ソート
ldap_sort($ds, $sr, 'sn');
// データの取得
$info = ldap_get_entries($ds, $sr);