I haven't been able to find anything while exploring the code and searching for documentation. Has anyone been able to achieve this?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
No, you can't. (Hard to believe, right?)
PHP uses Mark Crispin's c-client library under the hood to do its IMAP work. In the c-client library, there is a deprecated method
mail_criteria
inmail.c
that translates an IMAP search string to a c-client search program.mail_criteria
has been deprecated for the past 8 years or so and, as such, was never updated to support the IMAP4 search syntax. So search terms likeOR
that weren't present in IMAP2 never got support in themail_criteria
function. Here's all the terms it supports starting with an 'O
':OR
isn't on that list. So even though the c-client supportsOR
in itsSEARCHPGM
structs, it doesn't parseOR
in the deprecatedmail_criteria
function.And PHP still uses
mail_criteria
to parse search queries. In 2011. So until either the c-client library un-deprecatesmail_criteria
and makes it IMAP4-compliant or PHP writes its own IMAP search parser, you are stuck with whatever IMAP2 supported. Which doesn't includeOR
.