Files
php-doc-ru/reference/imap/functions/imap-rfc822-parse-adrlist.xml
2023-12-23 21:34:40 +03:00

152 lines
3.8 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: e2f50c240bebc502a3d990d73633a6141f3bd9fd Maintainer: rjhdby Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="function.imap-rfc822-parse-adrlist" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>imap_rfc822_parse_adrlist</refname>
<refpurpose>Разбирает адресную строку</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>imap_rfc822_parse_adrlist</methodname>
<methodparam><type>string</type><parameter>string</parameter></methodparam>
<methodparam><type>string</type><parameter>default_hostname</parameter></methodparam>
</methodsynopsis>
<para>
Разбирает адресную строку в соответствии с <link
xlink:href="&url.rfc;2822">RFC2822</link> для каждого адреса.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>string</parameter></term>
<listitem>
<para>
Строка с адресами
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>default_hostname</parameter></term>
<listitem>
<para>
Имя хоста по умолчанию
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Возвращает массив объектов со следующими свойствами:
</para>
<para>
<itemizedlist>
<listitem>
<simpara>
mailbox - имя ящика (пользователя)
</simpara>
</listitem>
<listitem>
<simpara>
host - имя хоста
</simpara>
</listitem>
<listitem>
<simpara>
personal - персональное имя
</simpara>
</listitem>
<listitem>
<simpara>
adl - "at-domain-list". Не используется.
</simpara>
</listitem>
</itemizedlist>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Пример использования <function>imap_rfc822_parse_adrlist</function></title>
<programlisting role="php">
<![CDATA[
<?php
$address_string = "Joe Doe <doe@example.com>, postmaster@example.com, root";
$address_array = imap_rfc822_parse_adrlist($address_string, "example.com");
if (!is_array($address_array) || count($address_array) < 1) {
die("something is wrong\n");
}
foreach ($address_array as $id => $val) {
echo "# $id\n";
echo " mailbox : " . $val->mailbox . "\n";
echo " host : " . $val->host . "\n";
echo " personal: " . $val->personal . "\n";
echo " adl : " . $val->adl . "\n";
}
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
# 0
mailbox : doe
host : example.com
personal: Joe Doe
adl :
# 1
mailbox : postmaster
host : example.com
personal:
adl :
# 2
mailbox : root
host : example.com
personal:
adl :
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>imap_rfc822_parse_headers</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
-->