For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > November 2005 > Re: Why is this not stripping the newlines/returns from my HTMLtext area?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Why is this not stripping the newlines/returns from my HTMLtext area?
worzel

2005-11-18, 7:55 am

$string=eregi_replace("[\n\r]+","",$_POST['address']); This did the trick!

Seems to be this is a very basic thing yet it seems no definitive function
to do it? I ws barking up the right tree, knoew what the issues were, yet
still found it a tricky thing to pin down? Is there no dedicated function fo
rthis, must catch a few folk off guard??

Anyway, thanks man, very much appreciated.

"Philip Ronan" <invalid@invalid.invalid> wrote in message
news:BFA3869E.3B142%invalid@invalid.invalid...
> "Connector5" wrote:
>
>
> Some Mac browsers will juse use a single \r for line breaks. It's probably
> better to replace any combination of \n and/or \r like this:
>
> $string=eregi_replace("[\n\r]+","",$_POST['address']);
>
> --
> phil [dot] ronan @ virgin [dot] net
> http://vzone.virgin.net/phil.ronan/
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com