Escaping quotes for imap_search
| From: | Chris Campbell | Date: | Tue, 04 Jul 2000 00:05:03 +0000 |
| Subject: | Escaping quotes for imap_search | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-4611@lists.php.net to get a copy of this message | ||
Hi,
I'm having a problem with the imap_search function when the search text
contains double quotes (and possibly some other special characters).
Escaping these characters with addslashes doesn't do the trick. Here's
what I'm trying to do:
$header = imap_fetchheader($source_stream, $msglist[$i], FT_UID);
...
$body = imap_body($source_stream, $msglist[$i], FT_UID);
...
$message = $header . $body;
imap_append($dest_stream, "{ipz1.imagepower.com:143}INBOX", "$message");
...
$temp_num = imap_search($dest_stream, "BODY \"$body\"", SE_UID);
After this, $temp_num[0] has the number of the message in the new
mailbox it has been copied to. But when the message contains double
quotes, this value is not set. I've also tried setting the criteria
string as follows, to no avail: 'BODY "' . addslashes($body) . '"'
Can anyone help me here? Replies to my email address in addition to the
list/ng would be appreciated.
Thanks,
Chris Campbell