When non-alphanumeric characters are presented in user data to be included as part of a Web page address, they need to be encoded into the percent (%) sign format as required by the application/x-www-form-urlencoded standard. This page allows you to learn and test the urlencode() function to perform URL encoding.
What is URL Encoding?
URL encoding is an Internet standard defined in RFC1738 to protect special characters as part of user data included Web URL strings. URL encoding requires that all non-alphanumeric characters except -_. to be replaced with a percent (%) sign followed by two hex digits and spaces replaced as plus (+) signs. For example,
String: $99.99 and 10% tax URL encoded: %2499.99+and+10%25+tax
How to use and test urlencode() PHP function?
urlencode(string) converts the input string according to the URL encoding rules.
To help you learn and test urlencode() function, FYIcenter.com has designed this online testing page. All you need to do is to enter the testing string in the form below and click the Start button. The converted string will be presented in the result area.
Other On-line Testing Pages by FYIcenter.com
FYIcenter.com has prepared some simple but very interesting on-line testing pages that are useful for your programming and testing tasks:
Each tutorial answers one commonly asked PHP programming question with a short, but precise and clear PHP script.