Re: can't get any string replacements to clean this
| From: | Dennis Gearon | Date: | Fri, 14 Mar 2003 06:49:49 +0000 |
| Subject: | Re: can't get any string replacements to clean this | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-139674@lists.php.net to get a copy of this message | ||
ooops, after many hours on this, I had deleted out the final echo
statement. I will play with this and see what I get now.
<?PHP
$bad_str = " \t\t\t\\r\\\r\r\r\r\n\r\nFour
schore ...........and seven \n\n\n\n\nr\r\r\rn\r years
ago, ,,,,,,, ,,,,,,,our father created on tis planet
\t\t\t\\r\\\r\r\r\r\n\r\nFour ";
echo( "<br>\nuncleaned
string----------------------------------------------------------------------<br>\n");
echo($bad_str . "<br>\nn" );
echo( "<br>\ncleaned
string---------------------------------------------------------------------------<br>\n");
$bad_str = str_replace( "\r", "\n", $bad_str );
echo( $bad_str );
echo("</pre>\n");
?>