Re: Removing ^M
| From: | Sqlcoders.com Programming Dept | Date: | Sun, 09 Jun 2002 00:43:00 +0000 |
| Subject: | Re: Removing ^M | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-101279@lists.php.net to get a copy of this message | ||
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" <olc@ninti.com>
To: "PHP List" <php-general@lists.php.net>
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
>
>