mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 13:57:03 +08:00
124 lines
6.3 KiB
HTML
124 lines
6.3 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
<title>Get attributes from a search result entry</title>
|
|
</head>
|
|
<body class="docs"><div id="layout">
|
|
<div id="layout-content"><div id="function.ldap-get-attributes" class="refentry">
|
|
<div class="refnamediv">
|
|
<h1 class="refname">ldap_get_attributes</h1>
|
|
<p class="verinfo">(PHP 4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">ldap_get_attributes</span> — <span class="dc-title">Get attributes from a search result entry</span></p>
|
|
|
|
</div>
|
|
|
|
<div class="refsect1 description" id="refsect1-function.ldap-get-attributes-description">
|
|
<h3 class="title">说明</h3>
|
|
<div class="methodsynopsis dc-description">
|
|
<span class="methodname"><strong>ldap_get_attributes</strong></span>
|
|
( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$link_identifier</code></span>
|
|
, <span class="methodparam"><span class="type">resource</span> <code class="parameter">$result_entry_identifier</code></span>
|
|
) : <span class="type">array</span></div>
|
|
|
|
<p class="para rdfs-comment">
|
|
Reads attributes and values from an entry in the search result.
|
|
</p>
|
|
<p class="para">
|
|
Having located a specific entry in the directory, you can find out what
|
|
information is held for that entry by using this call. You would use this
|
|
call for an application which "browses" directory entries and/or where you
|
|
do not know the structure of the directory entries. In many applications
|
|
you will be searching for a specific attribute such as an email address or
|
|
a surname, and won't care what other data is held.
|
|
<div class="informalexample">
|
|
<div class="example-contents">
|
|
<div class="cdata"><pre>
|
|
return_value["count"] = number of attributes in the entry
|
|
return_value[0] = first attribute
|
|
return_value[n] = nth attribute
|
|
|
|
return_value["attribute"]["count"] = number of values for attribute
|
|
return_value["attribute"][0] = first value of the attribute
|
|
return_value["attribute"][i] = (i+1)th value of the attribute
|
|
</pre></div>
|
|
</div>
|
|
|
|
</div>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 parameters" id="refsect1-function.ldap-get-attributes-parameters">
|
|
<h3 class="title">参数</h3>
|
|
<p class="para">
|
|
<dl>
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">link_identifier</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
An LDAP link identifier, returned by <span class="function"><a href="ldap_connect.html" class="function">ldap_connect()</a></span>.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">result_entry_identifier</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 returnvalues" id="refsect1-function.ldap-get-attributes-returnvalues">
|
|
<h3 class="title">返回值</h3>
|
|
<p class="para">
|
|
Returns a complete entry information in a multi-dimensional array
|
|
on success and <strong><code>FALSE</code></strong> on error.
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 examples" id="refsect1-function.ldap-get-attributes-examples">
|
|
<h3 class="title">范例</h3>
|
|
<p class="para">
|
|
<div class="example" id="example-5399">
|
|
<p><strong>Example #1
|
|
Show the list of attributes held for a particular directory entry
|
|
</strong></p>
|
|
<div class="example-contents">
|
|
<div class="phpcode"><pre><span style="color: #000000">
|
|
<span style="color: #0000BB"><?php<br /></span><span style="color: #FF8000">// $ds is the link identifier for the directory<br /><br />// $sr is a valid search result from a prior call to<br />// one of the ldap directory search calls<br /><br /></span><span style="color: #0000BB">$entry </span><span style="color: #007700">= </span><span style="color: #0000BB">ldap_first_entry</span><span style="color: #007700">(</span><span style="color: #0000BB">$ds</span><span style="color: #007700">, </span><span style="color: #0000BB">$sr</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$attrs </span><span style="color: #007700">= </span><span style="color: #0000BB">ldap_get_attributes</span><span style="color: #007700">(</span><span style="color: #0000BB">$ds</span><span style="color: #007700">, </span><span style="color: #0000BB">$entry</span><span style="color: #007700">);<br /><br />echo </span><span style="color: #0000BB">$attrs</span><span style="color: #007700">[</span><span style="color: #DD0000">"count"</span><span style="color: #007700">] . </span><span style="color: #DD0000">" attributes held for this entry:<p>"</span><span style="color: #007700">;<br /><br />for (</span><span style="color: #0000BB">$i</span><span style="color: #007700">=</span><span style="color: #0000BB">0</span><span style="color: #007700">; </span><span style="color: #0000BB">$i </span><span style="color: #007700">< </span><span style="color: #0000BB">$attrs</span><span style="color: #007700">[</span><span style="color: #DD0000">"count"</span><span style="color: #007700">]; </span><span style="color: #0000BB">$i</span><span style="color: #007700">++) {<br /> echo </span><span style="color: #0000BB">$attrs</span><span style="color: #007700">[</span><span style="color: #0000BB">$i</span><span style="color: #007700">] . </span><span style="color: #DD0000">"<br />"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?></span>
|
|
</span>
|
|
</pre></div>
|
|
</div>
|
|
|
|
</div>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 seealso" id="refsect1-function.ldap-get-attributes-seealso">
|
|
<h3 class="title">参见</h3>
|
|
<p class="para">
|
|
<ul class="simplelist">
|
|
<li class="member"><span class="function"><a href="ldap_first_attribute.html" class="function" rel="rdfs-seeAlso">ldap_first_attribute()</a> - Return first attribute</span></li>
|
|
<li class="member"><span class="function"><a href="ldap_next_attribute.html" class="function" rel="rdfs-seeAlso">ldap_next_attribute()</a> - Get the next attribute in result</span></li>
|
|
</ul>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
</div></div></div></body></html> |