You are here: Re: eregi_replace confusion « All PHP « IT news, forums, messages
Re: eregi_replace confusion

Posted by Janwillem Borleffs on 09/28/56 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);
>

Using the POSIX or PCRE based functions is overhead for simple replacements;
simply apply the str_replace function:

$testname = str_replace("\r", '', $testname);


JW

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация