It's not a bug. + is an encoded version of <space> (and %20 is as well)
+ is supposed to be represented in a URL with %2B 2010/1/4 matt_thomson <[email protected]>: > Hi, I have a script that runs like: search.php?terms=dog+cat+rabbit > > echo $_GET['terms'] will output "dog cat rabbit" not "dog+cat+rabbit" > > This is not desirable as I want to be able to tell the difference > between the end of a search term, and a space within a search term. I > also want to use the plus, as it is intuitive for users if they want > to edit the url manually. > > I have googled around and found a description of the why plus is > replaced with a space here: > > http://bugs.php.net/bug.php?id=39078 > > But there doesn't seem like there is any simple solutions. I am > currently thinking it might be easiest to use $_SERVER["REQUEST_URI"] > then regular expression it, but that seems like a bit of an ugly last > resort way, does anyone have any better solutions. > > Thanks, > > Matt. > > -- > NZ PHP Users Group: http://groups.google.com/group/nzphpug > To post, send email to [email protected] > To unsubscribe, send email to > [email protected] > -- Chris Hope The Electric Toolbox Ltd Email: [email protected] Web: www.electrictoolbox.com Phone: +64 9 522 9531 Mobile: +64 21 866 529 -- NZ PHP Users Group: http://groups.google.com/group/nzphpug To post, send email to [email protected] To unsubscribe, send email to [email protected]
