Reputation: 151
On server:
Browser Url--->http://www.mysite.com/?email=external%2Buser%40gmail.com
Email passed in browser--->external%2Buser%40gmail.com
Email After Encode--->external%5Euser%40gmail.com /* using urlencode function */
Email After Decode--->external^[email protected] /* using urldecode function */
On Localhost:
Browser Url--->http://localhost/test.php?email=external%2Buser%40gmail.com
Email passed in browser--->external%2Buser%40gmail.com
Email After Encode--->external%2Buser%40gmail.com /* using urlencode function */
Email After Decode--->[email protected] /* using urldecode function */
In above code i don't know why server result is different than localhost. on server %2B(+)
is converted into %5E(^)
while urlencode
. I want same result as localhost. Please help me on this.
Upvotes: 1
Views: 6170
Reputation: 48751
You'd better use rawurldecode()
instead of urldecode()
and rawurlencode()
instead of urlencode()
.
Upvotes: 2
Reputation: 5012
This is most likely to the different character encoding on your server
and localhost
Try converting them to a common character set
as
urlencode( utf8_decode($strContent) );
Upvotes: 0