in PHP:
the urlencode method applies the URL encoding rule to the specified string. For example, a space is changed to a plus sign. In homepage, form data transmission uses urlencode encoding before being sent. All non-letter characters (except-, _,.) are replaced with two hexadecimal numbers after %, and spaces are replaced with the + number.
urldecode, decodes the code in the form of % # into a specified character, and the plus sign is decoded into a space.
original:
http://cn.php.net/urlencode
http://cn.php.net/manual/en/function.urldecode.php
http://baike.baidu.com/view/2996406.htm
in JS:
encodeuricomponent () the function can encode a string as a URI component. This method does not encode ASCII letters and numbers, and does not encode these ASCII punctuation marks :-_.! ~ *'().
other characters (such :;/?: @ & =+ $, # The punctuation marks used to separate URI components) are all replaced by one or more hexadecimal escape sequences.
note:
encodeuricomponent () function and encodeuri () function, the former assumes that its parameters are part of the URI (such as the Protocol, Host name, path, or query string ). Therefore, the encodeuricomponent () function uses escape characters to separate the punctuation marks of each part of the URI.
decodeuricomponent decodes the image.
Original article:
Http://www.w3school.com.cn/js/jsref_encodeURIComponent.asp