downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

imap_timeout> <imap_subscribe
Last updated: Fri, 14 Aug 2009

view this page in

imap_thread

(PHP 4 >= 4.0.7, PHP 5)

imap_threadRetourne l'arbre des messages organisés par thread

Description

array imap_thread ( resource $imap_stream [, int $options= SE_FREE ] )

Retourne l'arbre des messages organisés par thread.

Liste de paramètres

imap_stream

Un flux IMPA retourné par la fonction imap_open().

options

Valeurs de retour

imap_thread() retourne un tableau associatif contenant un arbre de messages organisés par thread par REFERENCES ou FALSE en cas d'erreur.

Chaque message dans la boîte aux lettres courante sera représenté par des entrées sous forme d'arbre dans le tableau résultant :

  • $thread["XX.num"] - numéro du message courant

  • $thread["XX.next"]

  • $thread["XX.branch"]

Exemples

Exemple #1 Exemple avec imap_thread()

<?php

// Ici, nous affichons les threads d'un newsgroup, en 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);

?>



add a note add a note User Contributed Notes
imap_thread
mail at moritz-lapp dot de
05-Aug-2004 10:47
One possible option to imap_thread is the constant SE_UID, which will make imap_thread return UIDs instead of sequence numbers in the x.num-fields of the returned array.

imap_timeout> <imap_subscribe
Last updated: Fri, 14 Aug 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites