Home  >  Article  >  Backend Development  >  关于php urlencode使用的有关问题

关于php urlencode使用的有关问题

WBOY
WBOYOriginal
2016-06-13 13:36:11771browse

关于php urlencode使用的问题
$a = explode("|",'旺旺账号|旺旺账号|旺旺账号|旺旺账号');
echo urlencode($a[0]);

$a[0] 输出的值为:旺旺账号,正常的URL编码为:%cd%fa%cd%fa%d5%cb%ba%c5
但是上面代码得到的数值为:%CD%FA%CD%FA%D5%CB%BA%C5%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00
后面会出现很多%00这样的
这是为什么,正确应该怎么操作

------解决方案--------------------
啊,我的怎么是正常的呢?
旺旺账号的gbk编码下的urlencode就是%CD%FA0%CD%FA%D5%CB%BA%C5

Statement:
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