Re: urlencode() and newlines?
| From: | Nick Wilson | Date: | Sat, 16 Oct 2004 15:26:22 +0000 |
| Subject: | Re: urlencode() and newlines? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-199637@lists.php.net to get a copy of this message | ||
* and then Marek Kilimajer declared....
> Nick Wilson wrote:
> >hello all,
> >
> >For reasons beyond my immediate control i have to keep some strings of
> >text in a text *new line delimited* text file. I also have to urlencode
> >those strings for use in my script.
> >
> >Like this:
> >
> >## text file
> >This is a line\nThis is another line
> >This is another string\nwith some more\nnew lines
> >
> >Problem is, that urlencoding those lines doesnt seem to work well the
> >the \n's - when they get to where they are going (another server, not in
> >my control) the new lines are no longer there...
> >
> >Can anyone tell me how to get round this issue without storing the
> >strings in another way? - many thanks! ;-)
>
> Because what you are doing is not urlencoding. Try
>
> echo urlencode("This is a line\nThis is another line");
Yep, i can see that it's encoded but when the data is POSTed to a form,
it does not come out as a newline...
--
Nick W