PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
For the most part everything is working fine. But with one email content the filter_var() is not functioning properly. Specifically:
The Token echo is returning: DDuck@yahoo.com Subject: Notice the space between .com and Subject
After the $token is run through filter_var() it returns the following: JAminson@yahoo.comSubject. Subject is now added to the email address.
Does anyone have any idea how to handle this. Most of the email addresses are extracting just fine, but there are a few that come back with another word appended to the end of the address. Any help is appreciated.
foreach(preg_split("/[\s,]+/", $content) as $token)
Thanks for your input Benjamin - regex just drives me nuts. I don't understand the logic and have to look for examples on the internet. A cumbersome approach, I know. Hopefully, the more I use regex, the better I'll get at it.