Heim  >  Artikel  >  Backend-Entwicklung  >  小弟我碰到了PHP的BUG?

小弟我碰到了PHP的BUG?

WBOY
WBOYOriginal
2016-06-13 10:08:12983Durchsuche

我碰到了PHP的BUG???

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->$array['tt'] = "xx";$array['current-value'] = "abcde";echo http_build_query($array);


按道理应该显示
Assembly code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->tt=xx&current-value=abcde


可是现在运行却显示
Assembly code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->tt=xx¤t-value=abcde 


我碰到了PHP的关键字BUG???

------解决方案--------------------
我运行了你的代码,没有出现你说的结果,输出结果是
tt=xx¤t-value=abcde
------解决方案--------------------
不是php 的bug 是浏览器中¤被html转义了
用命令行执行没有问题
------解决方案--------------------
楼主把数组print_a看看。
------解决方案--------------------
你这么echo出来就被浏览器解析了,问题是你为啥要直接输出这个东西,一般是拼接参数做http请求用的。
PHP code
echo "&curren";echo "&gt";echo "&lt";<div class="clear">
                 
              
              
        
            </div>
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn