i have the following code:
$url = "http://www.my_site.com/my_file.php?county=West Lothian";
$html = "<a href=$url>Go</a>";
my_file.php
parse_url($_SERVER['QUERY_STRING']);
echo $county;
My problem is that in this case the query string is "West Lothian", but the value of $county is just "West" due to the space. I have tried using %20 in the top line of the first code snippet ($url = "http://www.my_site.com/my_file.php?county=West%20Lothian"; ) but that just resolves to the same thing. I have also tried escaping the %20 (i.e. \%20) but that doesn't work either.
Can anyone tell me how to get round this?
TYIA