Home > Backend Development > PHP Tutorial > js/php encodeURI_PHP tutorial

js/php encodeURI_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 17:44:30
Original
1544 people have browsed it

The

encodeURI() function can encode a string as a URI, and the characters will be replaced by hexadecimal escape sequences.
The decodeURI() function can decode the URI encoded by the encodeURI() function.

The characters after encodeURI() of js are generally encoded in utf-8. If the server-side encoding is a different encoding, iconv conversion is required.
$a = urlencode(iconv("gb2312", "UTF-8", "Movie")); //Equivalent to javascript encodeURI("Movie");
echo $ a;
$b = iconv("utf-8","gb2312",urldecode("%E7%94%B5%E5%BD%B1")); //Equivalent to javascript decodeURI("%E7% 94%B5%E5%BD%B1");
echo $b;
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478743.htmlTechArticleencodeURI() function can encode a string as a URI, and the characters will be hexadecimal escape sequences Make a substitution. The decodeURI() function can decode the URI encoded by the encodeURI() function...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template