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 10/31/05 10:41

JackM wrote:
> $value = preg_replace("(\r\n|\n|\r|\t)", "", $value);

That is not a pattern, it needs pattern delimiters at the start and end.
You don't need the parentheses because there's nothing outside them. Use a
quantifier to match series of newlines/tabs. Use a character class to
match different combinations of characters. I always use single quotes
around patterns to minimize the use of backslashes.

$value = preg_replace('/[\r\n\t]+/', '', $value);

--
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

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