ldap_parse_result

(PHP 4 >= 4.0.5, PHP 5, PHP 7, PHP 8)

ldap_parse_result結果から情報を展開する

説明

ldap_parse_result(
    resource $ldap,
    resource $result,
    int &$error_code,
    string &$matched_dn = null,
    string &$error_message = null,
    array &$referrals = null,
    array &$controls = null
): bool

LDAP の検索結果をパースします。

パラメータ

ldap

ldap_connect() が返す LDAP リンク ID。

result_identifier

ldap_list() あるいは ldap_search() が返す LDAP 結果リソース。

error_code

結果に含まれる LDAP エラーコードを格納する変数への参照。 エラーが発生しなかった場合は、この変数に 0 を格納します。

matched_dn

リクエスト内にマッチする DN があった場合に、それを格納する変数への参照。 なかった場合は、この変数に null を格納します。

error_message

結果に含まれる LDAP エラーメッセージを格納する変数への参照。 エラーが発生しなかった場合は、この変数に空文字列を格納します。

referrals

結果に含まれるすべての照会文字列の配列を格納する変数への参照。 存在しない場合は、この変数に空の配列を格納します。

controls

レスポンスを送信した LDAP コントロール の array

返り値

成功した場合に true を、失敗した場合に false を返します。

変更履歴

バージョン 説明
7.3 controls のサポートが追加されました。

例1 ldap_parse_result() の例

<?php
$result 
ldap_search($link"cn=userref,dc=my-domain,dc=com""(cn=user*)");
$errcode $dn $errmsg $refs =  null;
if (
ldap_parse_result($link$result$errcode$dn$errmsg$refs)) {
    
// $errcode や $dn、$errmsg、$refs を使って何かをします。
}
?>

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top