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', $topic);
$link_value = str_replace(' ', '%20', $topic);
Here's the strange part.
If the "ampersand replace" is in front of the "space replace" the "space
replace" gets done but the ampersand doesn't.
If the "ampersand replace" is done after the "space replace" the
ampersand get's replaced but the spaces do not.
So for the code above the %20 was replaced but the & remained &.
I split the lines up for simplicity. Is that's what's causing the
problems?
What am I missing here?
Very confusing.
Thanks for any info any one might have on this.
Thoughts, Comments, Anecdotes?
-Sterling
--
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]