Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online

imap thread function syntax tag tutorial 2013 Donate at flattr Flattr this

Alert! Connect with 10,000 Chating Online. Join Now

Php imap thread () function

Write your php code

<?php ?>

Php Result

Your code below

(PHP 4 >= 4.1.0, PHP 5)

imap_thread --  Returns a tree of threaded message


array imap_thread ( resource stream_id [, int options] )

imap_thread() returns an associative array containing a tree of messages threaded by REFERENCES, or FALSE on error.

Every message in the current mailbox will be represented by three entries in the resulting array:

  • $thread["XX.num"] - current message number

  • $thread[""]

  • $thread["XX.branch"]

Example 1. imap_thread() Example


// Here we're outputting the threads of a newsgroup, in HTML

$nntp = imap_open('{}some.newsgroup', '', '');
$threads = imap_thread($nntp);

foreach (
$thread as $key => $val) {
$tree = explode('.', $key);
  if (
$tree[1] == 'num') {
$header = imap_headerinfo($nntp, $val);
"<ul>\n\t<li>" . $header->fromaddress . "\n";
  } elseif (
$tree[1] == 'branch') {



Php imap thread Function syntax tag

imap thread php code on this is provided for your study purpose, it will guide you to know how create and design a website using php. use it to practice and train your self online

Php imap thread syntax tutorial

php tutorial guide and code design are for easy learning and programming. The code practice section provided at the top is for practising of this syntax. Use the code section up to practice your php programming online. Learning php is very easy, all you need is to use the examples on this site and practice them to perfect your skills.

Function index







Date & Time

Directory function




Form data handling

Mathematics operators


Php Mysql

Network Functions


php tutorial guides,functions, classes, code examples and tags for creating simple dynamic site to mysql database driven sites
Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online