Reputation: 13
Is it possible to encode space to a '-' in the URL.
Kindly assist me.
[edit: fixed confusing 'a-']
Upvotes: 1
Views: 1223
Reputation: 923
str_replace('%20', '-', 'your url here');
Now I'm confused with the question, lol.
Upvotes: 4
Reputation: 2966
You can make a rewrite rule to translate dashes into spaces, so when the request comes in it is properly handled. The problem will be making the links correct when they are rendered. You'll have to manually replace spaces with dashes before you do any sort of URLEncode.
Upvotes: 0