I've tried using rawurlencode and urlencode, both give me "&" and the other "+".
What i'm asking is, is there a PHP function that puts "-" in between words, like on Stack Overflow?
Thanks
I've tried using rawurlencode and urlencode, both give me "&" and the other "+".
What i'm asking is, is there a PHP function that puts "-" in between words, like on Stack Overflow?
Thanks
If thats all you're trying to do, you could just use:
$url = str_replace(" ", "-", $url);
And then use urlencode
to encode it after that. E.G.:
function myurlencode($url)
{
return urlencode(str_replace(" ", "-", $url));
}
EDIT
And according to the PHP manual, it replaces all non-alphanumeric characters except -_. with a percent (%) sign followed by two hex digits and spaces encoded as plus (+) signs.