php-doc-en/reference/ldap/functions/ldap-get-values.xml
Torben Wilson af4410a7e1 Normalized the sgml-default-dtd-file local-variable line for those
still using this, after discussion on the phpdoc list.
From now on, manual.ced will need to be found at ~/.phpdoc/manual.ced.



git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@288721 c90b9560-bf6c-de11-be94-00142212c4b1
2009-09-25 07:04:39 +00:00

146 lines
4 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<refentry xml:id="function.ldap-get-values" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>ldap_get_values</refname>
<refpurpose>Get all values from a result entry</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<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>
Reads all the values of the attribute in the entry in the result.
</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>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>link_identifier</parameter></term>
<listitem>
<para>
An LDAP link identifier, returned by <function>ldap_connect</function>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>result_entry_identifier</parameter></term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>attribute</parameter></term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns an array of values for the attribute on success and &false; on
error. 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>
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>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>List all values of the "mail" attribute for a
directory entry </title>
<programlisting role="php">
<![CDATA[
<?php
// $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.<br />";
for ($i=0; $i < $values["count"]; $i++) {
echo $values[$i] . "<br />";
}
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>ldap_get_values_len</function></member>
</simplelist>
</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:"~/.phpdoc/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
-->