I am using the libraray PHP function imap_search imap_search() to search for emails in a Gmail inbox through the subject line.
imap_seach($mbox, 'ALL SUBJECT "<search string>"');
This search is great for alphanumeric strings, but doesn't work when it has special characters, such as a slash, comma, colon, single quote, hyphen, and many other characters that I don't even know about. Running away from them does not help. Replacing some of them with space helps at one time, but not in all cases.
Is there a standard way to filter a search string so that it never logs out or returns a result? I tried to fake a sting topic and remove all words from the search bar that contain even one alphanumeric character. This basically works, but fails when all words have a non-alphanumeric character (which is common to one or two words).
source share