Ok i'm trying to link to this other page in this format:
echo "<a href=http://www.website.com/folder/$letter/$art/>Link</a>";
but if the string "$art" has spaces in it, such as "a buck short", the link actually links to this address:
http://www.website.com/folder/a/a
it doesn't keep the whole variable in the link as i need it to. I need it to link to:
http://www.website.com/folder/a/a buck short/
can anyone help me with this probably very basic problem? thanks
spaces in a string for linking
Moderator: General Moderators
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
Code: Select all
$str = str_replace(' ', '', $str);Code: Select all
$str = str_replace(' ', '%20', $str);