HTML URL Encoding Reference W3Schools
URL Encoding Functions. In JavaScript, PHP, and ASP there are functions that can be used to URL encode a string. PHP has the rawurlencode () function, and ASP has the () function. In JavaScript you can use the encodeURIComponent () function. Click the "URL Encode" button to see how the JavaScript function encodes the text.