Just point me towards a function, and I'll see if I can do it from there
Replace "%20" with a space in a string!
Moderator: General Moderators
Replace "%20" with a space in a string!
I have a string, lets say $username. I want to go through that string and replace all the "%20" with space so something like post%20a%20new%20topic would turn into post a new topic.
Just point me towards a function, and I'll see if I can do it from there
Just point me towards a function, and I'll see if I can do it from there
- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York
str_replace()
Its a pretty simple function, if you need help come back and post.
Its a pretty simple function, if you need help come back and post.
Code: Select all
$username = "post%20a%20new%20topic";
$new = str_replace("%20"," ", $username);
// $new would echo out to be "post a new topic"
Last edited by nickman013 on Sun Feb 26, 2006 10:45 pm, edited 1 time in total.
you pretty much solved your own question in your topic title 
replace .... string
str_replace()
or use urldecode()
replace .... string
or use urldecode()
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York
Same thing pretty much.
Code: Select all
$blah = "this has spaces";
str_replace(" ", "", $blah);
//$blah will echo out with no spaces now