[PHP] Escaping Characters - URL Encoding.

2001-04-24 Thread Sterling
H- 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. Here is a snippet of code. $topic = Aerospace Commercial Space; $link_value = str_replace(, '%26',

Re: [PHP] Escaping Characters - URL Encoding.

2001-04-24 Thread Alexander Wagner
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

Re: [PHP] Escaping Characters - URL Encoding.

2001-04-24 Thread Rasmus Lerdorf
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(,