Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does str_replace of \n introduce '!' in mail content?

Tags:

php

$mailContent=str_replace(" "," ",$mailContent); $mailContent=str_replace("\n"," ",$mailContent);

Why do the above lines introduce '!' at random points in my mail content?

Input:

http://pastebin.com/7eG6d3SH

Output:

Input :

like image 379
mercy Avatar asked Oct 20 '22 13:10

mercy


1 Answers

I actually had a huge problem with this just yesterday.

Basically, your lines are too long, and out of desperation it's throwing in !\n to break it up so it can be transmitted effectively.

like image 145
Niet the Dark Absol Avatar answered Oct 23 '22 06:10

Niet the Dark Absol