ldap_get_attributes
取得返回資料的屬性。
語法: array ldap_get_attributes(int handle, int result_entry_identifier);
返回值: 數組
函數種類: 網絡繫統
本函數用來取得 LDAP 中所有資源的屬性。參數 handle 為打開 LDAP 的代號。參數 result_entry_identifier 將由 ldap_next_attribute() 沿用。返回值為數組資料,數組元素從零開始依次為屬性的值。例如
return_value["count"] : 屬性個數
return_value[0] : 第一個屬性
return_value[n] : 第n+1個屬性
return_value["attribute"]["count"] : 屬性值個數
return_value["attribute"][0] : 第一個屬性值
return_value["attribute"][i] : 第i+1個屬性值
下面範例為片段的程序
<?php $entry = ldap_first_entry($ds, $sr); $attrs = ldap_get_attributes($ds, $entry); echo $attrs["count"]." 筆屬性資料如下:<p>\n"; for ($i=0; $i<$attrs["count"]; $i++) { echo $attrs[$i]."<br>"; } ?>
ldap_first_attribute() ldap_next_attribute()
整理: 夕垌菪姬 (天地JPLOP)
|