|
Posted by Rik on 09/28/63 11:49
Mad Hatter wrote:
> I'm trying to replace characters in a string but getting totally
> confused. I want to strip \r off the end of a string. Example,
> sometext\r and I want to remove the \r
> I've tried the following variations plus a few others :-
>
> $testname=eregi_replace('\r',"",$testname);
> $testname=eregi_replace('\\r',"",$testname);
> $testname=eregi_replace('[\r]',"",$testname);
>
> Nothing works as I want it. All I want is to remove all \r (and all
> \r but once I get one woriing I should be able to get the other) off
> an inputed string.
>
> The php.net web site has confused me even more.Help?
$testname=preg_replace("/\r/","",$testname);
Notice the double quote.
Grtz,
--
Rik Wasmus
Navigation:
[Reply to this message]
|