Hello Readers
Urlencode can be used to encode the given string that can be used as a url. Urlencode replaces the ASCII characters with % followed by two hexadecimal digits.
OR
Other non-alphanumeric characters are converted % followed by two hex digits representing the converted character.
Space characters are converted to + characters.
It is normally used when the browser sends form data to a web server.
Syntax of urlencode: urlencode (string $str )
For example:
$discount ="10.00%";
$url = "http://domain.com/submit.php?disc=".urlencode($discount);
echo $url;
You will get the below output:
"http://domain.com/submit.php?disc=10%2E00%25
Urldecode can be used to decode the string. Decodes any "%##"" encoding in the given string.
It is normally used when the browser sends form data to a web server.
Syntax of urldecode: urldecode (string $str )
0 Comment(s)