I am writing a web application and learning how to urlencode html links...
All the urlencode questions here (see tag below) are \"How to...?\" questions.
M
The main reason is it essentially escapes characters to be included in the URL of your webpage.
Suppose a user inputs a user form field as "&joe" and we would like to redirect to a page which contains that name as part of the URL, using URL encoding, it would then be, for example:
localhost/index.php?name=%26joe //note how the ampersand is escaped
If you didnt use urlencoding, you would end up with:
localhost/index.php?name=&joe
and that ampersand would cause all sorts of unpredictability