Re: imap4 search criteria
| From: | Dominik Gehl | Date: | Fri, 12 Feb 2010 14:02:39 +0000 |
| Subject: | Re: imap4 search criteria | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-46980@lists.php.net to get a copy of this message | ||
Hi,
I was just wondering if there was any interest to get this enhancement into the PHP IMAP extension.
Should I re-sent the patch as an attachment ?
Thanks
Dominik
On 2010-02-04, at 7:01 PM, Dominik Gehl wrote:
>>> $pgm = imap_searchprogram_new();
>>> imap_searchprogram_criteria($pgm1,"DRAFT SMALLER 34567 HEADER Message-Id
>>> <D76C58CD-C94D-4DE4-B621-83D66437EFE3@dokdok.com> FROM dominik@dokdok.com");
>>
>> I assume you meant '$pgm' above?
>
> You are absolutely right !
>
> In fact, you can also set every parameter in its own imap_searchprogram_criteria call, so the
> above (without the typo) would be equivalent to the four calls below:
>
> imap_searchprogram_criteria($pgm,"DRAFT");
> imap_searchprogram_criteria($pgm,"SMALLER 34567");
> imap_searchprogram_criteria($pgm,"HEADER Message-Id
> <D76C58CD-C94D-4DE4-B621-83D66437EFE3@dokdok.com>");
> imap_searchprogram_criteria($pgm,"FROM dominik@dokdok.com");
>
> If you need a logical OR of several criteria, you would use the following calls:
>
> $pgm1 = imap_searchprogram_new();
> imap_searchprogram_criteria($pgm1,"DRAFT");
> $pgm2 = imap_searchprogram_new();
> imap_searchprogram_criteria($pgm2,"ANSWERED");
> $pgm = imap_searchprogram_or($pgm1, $pgm2);
> imap_search($mbox,$pgm);
>
>
> Dominik