PHP - Filtering Email Body, Removing Reply Quotes

前端 未结 1 1534
礼貌的吻别
礼貌的吻别 2020-12-29 12:23

I\'m working on an email piping script that needs to save just the reply content and not the original quoted email. I\'m using a mime parser class (http://www.phpclasses.org

1条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-29 13:01

    This might be doable with a regular expression. Try:

    $text = preg_replace('#(^\w.+:\n)?(^>.*(\n|$))+#mi', "", $text);
    

    0 讨论(0)
提交回复
热议问题