The encodeURIComponent () function encodes a string as a URI component.
Syntax: encodeURIComponent (uristring)
Parameter description: uristring required. A string that contains the URI component or other text to encode.
Return value: A copy of
Escape, encodeURI, encodeURIComponent 1) Basic Introduction JS to encode the text involves 3 functions: escape,encodeuri,encodeuricomponent, Corresponding 3 decoding functions:decodeuri,decodeuricomponent 2) Use 1, passing parameters need to use
JS to encode the text involves 3 functions: Escape,encodeuri,encodeuricomponent, the corresponding 3 decoding function: unescape,decodeuri,decodeuricomponent 1, passing parameters need to use encodeuricomponent, so that the combined URL will not be #
1. Eacape (): This method does not encode ASCII letters and numbers, nor does it encode the following ASCII punctuation marks: * @-_ +. / 。 All other characters will be replaced by escape sequences. In other cases the
Comparison | function |escape|encodeuri|encodeuricomponent
JS encoding text involves 3 functions: Escape,encodeuri,encodeuricomponent, corresponding 3 decoding functions: Unescape,decodeuri,decodeuricomponent
1, the transfer of parameters need to
In JS, encodeURIComponent is used to encode Chinese characters. in PHP, iconv is used (after the encodeURIComponent function in JS is used to encode Chinese characters, how can I use php to decode it ??
Prerequisites: The Chinese characters before
JS in the encodeURIComponent function to the Chinese code, how to use PHP decoding??
Prerequisite: The Chinese before encoding may be gbk,gb2312,utf-8 and so on.
Copy the Code code as follows:
UrlDecode ()Iconv ()
In JS using encodeURIComponent to
JS in the encodeURIComponent function to the Chinese code, how to use PHP decoding??
Prerequisite: The Chinese before encoding may be gbk,gb2312,utf-8 and so on.
Copy CodeThe code is as follows:
UrlDecode ()
Iconv ()
In JS using
In JS, encodeURIComponent is used to encode Chinese characters. in PHP, iconv (UTF-8, gb2312, $ q) is used, gb2312 depends on your actual application. if you still don't understand why do you use php to decode the encodeURIComponent function in the
JS Escape Escape (), encodeURI (), encodeURIComponent () differenceThere are three functions in JavaScript that can encode strings, namely: Escape,encodeuri,encodeuricomponent, corresponding 3 decoding functions: Unescape,decodeuri,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.