RE: [PHP] can't get any string replacements to clean this
| From: | Niklas Lampén | Date: | Fri, 14 Mar 2003 07:05:02 +0000 |
| Subject: | RE: [PHP] can't get any string replacements to clean this | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-139676@lists.php.net to get a copy of this message | ||
What are you trying to get out of that mess? What should the output look
like?
Niklas
-----Original Message-----
From: Dennis Gearon [mailto:gearond@cvc.net]
Sent: 14. maaliskuuta 2003 7:51
To: php-general@lists.php.net
Subject: [PHP] can't get any string replacements to clean this
All i get out of:
str_replace
ereg_replace
preg_replace
is an empty string value.
Anybody know why?
<?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
--------------------------------------------<br>\n");
//Nothing will clean on this line
$bad_str = preg_replace( '\r', '\n', $bad_str );
echo("</pre>\n");
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
###########################################
This message has been scanned by F-Secure Anti-Virus for Internet Mail. For
more information, connect to http://www.F-Secure.com/
###########################################
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/