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

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

WBOY
Release: 2016-06-23 14:12:29
Original
980 people have browsed it

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');
Copy after login

source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template