php-doc-en/reference/ldap/functions/ldap-get-values.xml
Hartmut Holzgraefe 5b9fc29465 revision tags added
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@78496 c90b9560-bf6c-de11-be94-00142212c4b1
2002-04-17 06:45:35 +00:00

95 lines
3.2 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- splitted from ./en/functions/ldap.xml, last change in rev 1.2 -->
<refentry id="function.ldap-get-values">
<refnamediv>
<refname>ldap_get_values</refname>
<refpurpose>Get all values from a result entry</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>ldap_get_values</methodname>
<methodparam><type>resource</type><parameter>link_identifier</parameter></methodparam>
<methodparam><type>resource</type><parameter>result_entry_identifier</parameter></methodparam>
<methodparam><type>string</type><parameter>attribute</parameter></methodparam>
</methodsynopsis>
<para>
Returns an array of values for the attribute on success and &false;
on error.</para>
<para>
<function>ldap_get_values</function> function is used to read all
the values of the attribute in the entry in the result. entry is
specified by the
<parameter>result_entry_identifier</parameter>. The number of
values can be found by indexing "count" in the resultant
array. Individual values are accessed by integer index in the
array. The first index is 0.</para>
<para>
This call needs a <parameter>result_entry_identifier</parameter>,
so needs to be preceded by one of the ldap search calls and one
of the calls to get an individual entry.</para>
<para>
You application will either be hard coded to look for certain
attributes (such as "surname" or "mail") or you will have to use
the <function>ldap_get_attributes</function> call to work out
what attributes exist for a given entry.</para>
<para>
LDAP allows more than one entry for an attribute, so it can, for
example, store a number of email addresses for one person's
directory entry all labeled with the attribute "mail"
<informalexample>
<literallayout>
return_value["count"] = number of values for attribute
return_value[0] = first value of attribute
return_value[i] = ith value of attribute
</literallayout>
</informalexample>
<example>
<title>List all values of the "mail" attribute for a
directory entry </title>
<programlisting role="php">
<![CDATA[
// $ds is a valid link identifier for a directory server
// $sr is a valid search result from a prior call to
// one of the ldap directory search calls
// $entry is a valid entry identifier from a prior call to
// one of the calls that returns a directory entry
$values = ldap_get_values($ds, $entry,"mail");
echo $values["count"]." email addresses for this entry.<p>";
for ($i=0; $i < $values["count"]; $i++)
echo $values[$i]."<br>";
]]>
</programlisting>
</example></para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->