Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding "+" signs in query strings

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
How would I go about adding a + sign between words submitted to a script? It is a content retrieval script:
Line is:

$url = "
When someone types in two words in the search box, it only displays 1 on the query string on my partner's site. For example, when I search for "free email", it only pulls the " part, not "?q=free email".

I want to be able to make it automatically format the string as "two+words+or+more", not "two words or more".

Please help me out here.

Thanks,
Josh
 
You could use the str_replace function for that. When a user enters "two or more users", you do:

$search = str_replace(" ","+",$search);

the result is "two+or+more+users"

that should help you out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top