English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I'm trying to let a user specify a comma-separated list of urls to my php function, but commas are a valid url character. How do I delimit the different chunks of urls? Are there any characters that are invalid that I could use instead like > or {?

The key is the character (or set of characters) must be something that you'd never see in an actual url.

2007-09-07 00:39:35 · 4 answers · asked by Anonymous in Computers & Internet Programming & Design

4 answers

Not sure if this would work, but the most obvious character that comes to my mind is the space. Its not a valid url character and its a natural separator.

I don't know anything about php, so if I'm way out in left field here, thats why, LOL.

2007-09-07 00:48:36 · answer #1 · answered by ForbiddenPC 3 · 0 0

With the exception of the domain you can have pretty much what you want in a Url, especially in the ?SearchQuery string.

You probably need to select a character that has to be escaped out (%xx). That could be the answer, use a % sign on its own which is normally followed by two hexadecimal digits.

The backslash character (\) may be a good candidate as the browser seems to convert it to a forwardslash (/).


_

2007-09-07 01:06:59 · answer #2 · answered by SadButTrue 4 · 0 0

I hate to break you the bad news but commas are not allowed in a URL Period.
If you intend to to a list of urls it must be done like this.
http://www.google.com
http://www.yahoo.com
Don

2007-09-07 00:49:54 · answer #3 · answered by Don M 7 · 1 0

Semicolon is traditional

2007-09-07 04:32:21 · answer #4 · answered by fjpoblam 7 · 0 0

fedest.com, questions and answers