You are here: Re: Function to strip returns « PHP Programming Language « IT news, forums, messages
Re: Function to strip returns

Posted by Ewoud Dronkert on 11/01/05 13:17

JackM wrote:
> ZeldorBlat wrote:
>
> >> $value = str_replace(array("\r", "\n", "\t"), '', $value);
>
> Ewoud Dronkert wrote:
>
> > $value = preg_replace('/[\r\n\t]+/', '', $value);
>
>
> Interesting. So what would the preferred method be or is that just
> splitting hairs?

In principle, I say prefer str_replace. Maybe if $value contained lots of
consecutive \r, \n or \t, the regexp might even be a little faster?
Actually I didn't think about the possibility to use an array argument for
str_replace so just used a regexp, with which I'm quite comfortable.

--
E. Dronkert

 

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

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