note 109381 added to function.imap-status

From: Date: Thu, 12 Jul 2012 13:33:10 +0000
Subject: note 109381 added to function.imap-status
Groups: php.notes 
Request: Send a blank email to php-notes+get-189109@lists.php.net to get a copy of this message
I had issues with imap_status not working correctly, while other imap functions seemed okay. I always got the ['flags']=0 response. No notes here and Google searching suggests it doesn't working properly with Exchange, so I wrote a little workaround, to at least get some information. <?php function my_imap_status($stream, $mailbox='', $info=SA_ALL) { // get current mailbox name (and info) $curr_obj=imap_check($stream); if(!$curr_obj) return false; // if request if for current mailbox then just return it if( (empty($mailbox)) || ($mailbox==$curr_obj->Mailbox) ) return $curr_obj; // get current mailbox $current_mailbox=$curr_obj->Mailbox; //switch to new mailbox if(!imap_reopen($stream, $mailbox)) return false; // get info $obj=imap_check($stream); // switch back to original mailbox imap_reopen($stream, $current_mailbox); //return info return $obj; } ?> ---- Server IP: 69.147.83.197 Probable Submitter: 81.144.235.82 ---- Manual Page -- http://www.php.net/manual/en/function.imap-status.php Edit -- https://master.php.net/note/edit/109381 Del: integrated -- https://master.php.net/note/delete/109381/integrated Del: useless -- https://master.php.net/note/delete/109381/useless Del: bad code -- https://master.php.net/note/delete/109381/bad+code Del: spam -- https://master.php.net/note/delete/109381/spam Del: non-english -- https://master.php.net/note/delete/109381/non-english Del: in docs -- https://master.php.net/note/delete/109381/in+docs Del: other reasons-- https://master.php.net/note/delete/109381 Reject -- https://master.php.net/note/reject/109381 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#189109) next »