I think your question is along the lines of,
$str = 'hello there, good to see you';
With this you cannot do,
$url = 'http://mysite.com?greeting='.$str.'';
greeting would just be hello (you can’t use spaces in a querystring).
to fix that you would need to do,
$str = urlencode($str);
Now you can get your entire querystring in $url.