This question already has an answer here:
I am using the PHP Function imap_open
to get emails and insert them into a database.
Whats the best way to see if the email is a reply or not
i have tried:
if(!substr($subject,0,3) == 'RE:')
to see if the first 3 characters of the subject DO NOT equal RE: but that didnt work, i have also tried without the ! but that didnt work either
any ideas?
</div>
You have a typo here.
if(!substr($subject,0,3) == 'RE:')
should be if(!(substr($subject,0,3) == 'RE:'))
OR try !==
if(substr($subject,0,3) !== 'RE:')