View Full Version : storing values from a URL into a string

05-23-2008, 09:58 PM
I'm passing a specified URL to my script, something along the lines of:


My script then parses the url and stores the values into an array.

Here's my dilemma:

I've got 4 types of models I want to pass in the URL and store that value in a variable as a string. My problem is, one of the models is "45+", but the "+" symbol isn't being saved in the string. I wonder if PHP reads it as an operator? Can anyone help with this?

05-23-2008, 10:03 PM
You need to urlencode the data before you pass it through the url. I believe the + sign is read as a space in some cases.

05-24-2008, 03:34 AM
Aero is correct. The + sign is used to represent a space in URL encoding. See the manual entry for urlencode() (http://php.net/urlencode) for more information.