Re: Escaping Characters - URL Encoding.
| From: | Alexander Wagner | Date: | Tue, 24 Apr 2001 21:37:49 +0000 |
| Subject: | Re: Escaping Characters - URL Encoding. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-50185@lists.php.net to get a copy of this message | ||
Sterling wrote:
> $topic = "Aerospace & Commercial Space";
>
> $link_value = str_replace("&", '%26', $topic);
> $link_value = str_replace(' ', '%20', $topic);
This should be
$link_value = str_replace("&", '%26', $topic);
$link_value = str_replace(' ', '%20', $link_value);
Anyway, this is this wrong way to go about it.
This line
$link_value = rawurlencode($topic);
will do the whole job.
regards
Wagner
--
"In place of infinity we usually put some really big number, like 15."
- Anonymous Computer Science professor