Home  >  Article  >  Backend Development  >  php不能正常打印字符串,如何解决

php不能正常打印字符串,如何解决

WBOY
WBOYOriginal
2016-06-23 14:12:29947browse

PHP URL

在开发过程中,我需要访问一个url

http://www.***.com/api/abc?a=123&b=234¶m=2

但是当我echo 'http://www.***.com/api/abc?a=123&b=234¶m=2';
在浏览器中显示的却是http://www.***.com/api/abc?a=123&b=234(特殊字符)m=2
!- - 特殊字符论坛也不让发,想知道是什么自己打印下
要如何来解决

回复讨论(解决方案)

html转义的问题,

echo htmlspecialchars('http://www.***.com/api/abc?a=123&b=234&param=2');

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