PHP Interview Question:

What is meant by urlencode and urldecode?

Submitted by: Administrator

Anwser 1:
urlencode() returns the URL encoded version of the given string. URL coding converts special characters into % signs followed by two hex digits. For example: urlencode("10.00%") will return "10%2E00%25". URL encoded strings are safe to be used as part of URLs.
urldecode() returns the URL decoded version of the given string.

Anwser 2:
string urlencode(str) - Returns the URL encoded version of the input string. String values to be used in URL query string need to be URL encoded. In the URL encoded version:

Alphanumeric characters are maintained as is.
Space characters are converted to "+" characters.
Other non-alphanumeric characters are converted "%" followed by two hex digits representing the converted character.

string urldecode(str) - Returns the original string of the input URL encoded string.

SHARE

Submit Your Feedback:

Your Location Is:

×

Thank You For Your Feedback!

Your message has been sent successfully.

Disclaimer

Interview Questions Answers .ORG is responsive and optimized web portal for individuals to get preparation for their job interviews, learning and training. Content at Interview Questions Answers .ORG might be simplified to improve our users experience.
We constantly review our content to avoid errors and copyright violations, but we cannot warrant full correctness of all the content.
While using this site, you agree to have read and accepted our terms of use,
cookie and privacy policy.
Copyright 2007-2018 by Interview Questions Answers .ORG All Rights Reserved.