开发者

Preg match - removing strange characters from an email address

开发者 https://www.devze.com 2023-04-02 07:07 出处:网络
could some suggest h开发者_运维问答ow using some form of preg_replace or similar function I can remove the dot just before the at sign within this email address -

could some suggest h开发者_运维问答ow using some form of preg_replace or similar function I can remove the dot just before the at sign within this email address -

a.d.q.s.@webdomin.co.uk

I have a system for sending emails but unfortunately due to the way the client collates data there is a number of incorrect email addresses added to their csv.

I use the SwiftMailer class and it isn't liking some of the emails within an array that are being passed from a csv.


What about this simple regex:

preg_replace('/\.\@/','@',$emailAddress);

Would this fit your needs or do you need something more complex?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号