Remove char from imap mail extract

i am trying to fetch a mail in imap from google, i'm using the imap() function from PHP IMAP library and i want to use a preg_match() call on my mail content but i have a strange issue, i have curious break lines altering the normal preg_match(). More details: I have in my markup something like that:
Résumé points de classement Extérieur Domicile
Équipe Milan Arsenal
Performance du match 0 19
Étoiles équipe 0 0
Points totaux 3195 3273
Niveau actuel 22 22
Points pour le prochain niveau 5 127
I am running this code to extract the body for example: The output of this code is:
string '

<TABLE' (length=13)
string '

<TABLE' (length=13)
And the extracted value is an empty array... After further investigation i discovered through a var_dump() of my source string that there is a at the end of each line. I have no clue of what this html char code is and how to remove it. If you can enlight me, i'll be thankfull ;) Have a nice day! EDIT: With a str_replace() it works! is in fact the \n break line. So the magic tricks is: $overview = imap_body($inbox,$email_number,0); $message = utf8_decode(quoted_printable_decode($overview)); $message = str_replace("\n", "", $message);

以上就是Remove char from imap mail extract的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » HTML5 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准