You could replace if by ASCII code (^M is actually a representation of ASCII 013, the CR character, thanks to http://www.mindspring.com/~jc1/serial/Resources/ASCII.html for the ASCII lookup table.).
This should fix it (untested) <? $chrnumber = 13; //this is the ascii code for ^M $nicestring = str_replace(chr($chrnumber),"(removed M was here)",$badstring); echo($nicestring); ?> where $nicestring is the output, $chrnumber contains the ascii code for ^M, and the input (original) string is $badstring. Sqlcoders.com Dynamic data driven web solutions ----- Original Message ----- From: "Michael Hall" <[EMAIL PROTECTED]> To: "PHP List" <[EMAIL PROTECTED]> Sent: June 08 2002 05:40 PM Subject: [PHP] Removing ^M > > > I am trying remove ^M characters (some kind of newline character) from an > HTML file. I've tried all sorts of ereg_replace and sed possibilities > but the > things just won't go away. Does anyone have a way of removing such > characters? > > TIA > > Mick > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php