I’m at my wits end here , I normally like to work things out on my own but this has me well and truly beaten here…
I’m trying to mod rewrite my urls that contain pluses…
I stand corrected.
I was assuming the situation where the is a form on the website with a GET action to produce an URL like [noparse]http://www.example.com/?q=my%20search%20terms[/noparse], in which case you need to use urldecode().
However, since this assumption is incorrect, your code (str_replace(‘-’, ’ ', $_GET[‘q’])) is indeed correct.
Interesting. I’ve never seen a GET form which could subvert a browser’s standard conversion of spaces to +'s.
If that were to happen, you’d have been correct that the urldecode() function would “fix” that problem and your code is a one-liner to read the GET value and replace the encoded spaces with actual space characters.