URGENT: Load an ENCODED URL using Header?

Ok I understand what your saying now. If you look at the php spec for urlencode here:
http://php.net/manual/en/function.urlencode.php

In example #2, you will see they use urlencode just on the value part of the get param. If you wanted to go this route you could do something along the lines of:


$encoded_url = "";
$url = "google.com?id=3 &test=y()&display=y";
$params = explode("?",$url);
$encoded_url .= $params[0]."?";
$param_array = explode("&",$params[1]);
foreach($param_array as $param){
	$pair = explode("=",$param);
	$encoded_url .= $pair[0]."=".urlencode($pair[1])."&";
}
print $encoded_url;