Reply to Re: [PHP] strip out too many newlines

Your name:

Reply:


Posted by Marco Tabini on 08/04/05 19:02

On 8/4/05 10:56 AM, "Sebastian" <sebastian@broadbandgaming.net> wrote:

> that works for my orginal request, but i found something else:
>
> $string = '[quote=xx]foo[/quote]\nmore text\r\n\r\n\r\n\r\nmore text';
>

Try removing double-instances of \r\n (or \n) before running the regex.


Marco

> now if they enter more carriage returns i get the results from above.
> its no big deal, but you always have someone trying to 'break' the system.
>
> thanks, i really need to learn some regexp.
>
> Marco Tabini wrote:
>
>> Try changing the
>>
>> \n*
>>
>> patterns to
>>
>> (?:\r?\n)*
>>
>> Cheers,
>>
>>
>> Marco
>>
>> --
>> BeebleX - The PHP Search Engine
>> http://beeblex.com
>>
>>
>> On 8/4/05 10:39 AM, "Sebastian" <sebastian@broadbandgaming.net> wrote:
>>
>>
>>
>>>>> [quote=user]
>>>>> foo
>>>>> [/quote]
>>>>>
>>>>> <bunch of extra lines>
>>>>>
>>>>> more text...
>>>>>
>>>>>
>>
>>
>>
>

[Back to original 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

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