Search code examples
phpurlencode

Urlencode everything but slashes?


Is there any clean and easy way to urlencode() an arbitrary string but leave slashes (/) alone?


Solution

    1. Split by /
    2. urlencode() each part
    3. Join with /