php-doc-en/reference/imap/functions/imap-thread.xml
Daniel Egeberg 96c9d88bad Converted to utf-8
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@297028 c90b9560-bf6c-de11-be94-00142212c4b1
2010-03-28 22:10:10 +00:00

110 lines
2.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id='function.imap-thread' xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>imap_thread</refname>
<refpurpose>Returns a tree of threaded message</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>imap_thread</methodname>
<methodparam><type>resource</type><parameter>imap_stream</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>options</parameter><initializer>SE_FREE</initializer></methodparam>
</methodsynopsis>
<para>
Gets a tree of a threaded message.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&imap.imap-stream.description;
<varlistentry>
<term><parameter>options</parameter></term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<function>imap_thread</function> returns an associative array containing
a tree of messages threaded by <literal>REFERENCES</literal>, or &false;
on error.
</para>
<para>
Every message in the current mailbox will be represented by three entries
in the resulting array:
<itemizedlist>
<listitem><para>
<varname>$thread["XX.num"]</varname> - current message number
</para></listitem>
<listitem><para>
<varname>$thread["XX.next"]</varname>
</para></listitem>
<listitem><para>
<varname>$thread["XX.branch"]</varname>
</para></listitem>
</itemizedlist>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>imap_thread</function> Example</title>
<programlisting role="php">
<![CDATA[
<?php
// Here we're outputting the threads of a newsgroup, in HTML
$nntp = imap_open('{news.example.com:119/nntp}some.newsgroup', '', '');
$threads = imap_thread($nntp);
foreach ($threads as $key => $val) {
$tree = explode('.', $key);
if ($tree[1] == 'num') {
$header = imap_headerinfo($nntp, $val);
echo "<ul>\n\t<li>" . $header->fromaddress . "\n";
} elseif ($tree[1] == 'branch') {
echo "\t</li>\n</ul>\n";
}
}
imap_close($nntp);
?>
]]>
</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:"~/.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
-->