> I've been able to escape the 'space' character in a variable so it can
> be safely passed through a URL but I'm having trouble finding anything
> that works for escaping the '&' ampsand.

php.net/urlencode

as for your code:

> $topic = "Aerospace & Commercial Space";
>
> $link_value = str_replace("&", '%26', $topic);
> $link_value = str_replace(' ', '%20', $topic);

You are using $topic both times.  Your second line should be:

  $link_value = str_replace(' ', '%20', $link_value);

-Rasmus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to