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