Home Backend Development PHP Tutorial 小弟我碰到了PHP的BUG?

小弟我碰到了PHP的BUG?

Jun 13, 2016 pm 01:35 PM
amp echo quot

我碰到了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);
Copy after login


按道理应该显示
Assembly code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->tt=xx&amp;current-value=abcde
Copy after login


可是现在运行却显示
Assembly code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->tt=xx¤t-value=abcde 
Copy after login


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

------解决方案--------------------
我运行了你的代码,没有出现你说的结果,输出结果是
tt=xx&current-value=abcde
------解决方案--------------------
不是php 的bug 是浏览器中&curren被html转义了
用命令行执行没有问题
------解决方案--------------------
楼主把数组print_a看看。
------解决方案--------------------
你这么echo出来就被浏览器解析了,问题是你为啥要直接输出这个东西,一般是拼接参数做http请求用的。
PHP code
echo "&amp;curren";
echo "&amp;gt";
echo "&amp;lt"; <div class="clear">
                 
              
              
        
            </div>
Copy after login
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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Five selected Go language open source projects to take you to explore the technology world Five selected Go language open source projects to take you to explore the technology world Jan 30, 2024 am 09:08 AM

Five selected Go language open source projects to take you to explore the technology world

Go language development essentials: 5 popular framework recommendations Go language development essentials: 5 popular framework recommendations Mar 24, 2024 pm 01:15 PM

Go language development essentials: 5 popular framework recommendations

Implementing distributed task scheduling using Golang's web framework Echo framework Implementing distributed task scheduling using Golang's web framework Echo framework Jun 24, 2023 am 11:49 AM

Implementing distributed task scheduling using Golang's web framework Echo framework

php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决 php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决 Jun 13, 2016 am 10:23 AM

php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决

Laravel development: How to implement WebSockets communication using Laravel Echo and Pusher? Laravel development: How to implement WebSockets communication using Laravel Echo and Pusher? Jun 13, 2023 pm 05:01 PM

Laravel development: How to implement WebSockets communication using Laravel Echo and Pusher?

Detailed explanation of the role and usage of the echo keyword in PHP Detailed explanation of the role and usage of the echo keyword in PHP Jun 28, 2023 pm 08:12 PM

Detailed explanation of the role and usage of the echo keyword in PHP

What coin is AMP? What coin is AMP? Feb 24, 2024 pm 09:16 PM

What coin is AMP?

Explore the Go language framework: 5 choices not to be missed! Explore the Go language framework: 5 choices not to be missed! Feb 19, 2024 pm 02:29 PM

Explore the Go language framework: 5 choices not to be missed!

See all articles