Home > Backend Development > PHP Tutorial > PHP strange error: htmlspecialchars handles Chinese missing_PHP tutorial

PHP strange error: htmlspecialchars handles Chinese missing_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-20 11:16:01
Original
1052 people have browsed it

<span $value</span> = "中文中文"<span ;
</span><span $res</span> = <span htmlspecialchars</span>(<span $value</span>);
Copy after login

After being processed by this function, $res directly becomes an empty string.

What a weird mistake! Later I found out that this is how to succeed. I have never encountered it before. It’s strange!

<span htmlspecialchars</span>(<span $value</span>, ENT_NOQUOTES, "gb2312");
Copy after login

It’s OK to deal with it this way. If you don’t know how serious it is, if you don’t know how serious it is...

BY THE WAY:PHP VERSION:5.3.10

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/440137.htmlTechArticle= "中文中文" = ( ); After being processed by this function, $res becomes empty directly. string. What a weird mistake! Later I found out that this is how to succeed, I have never encountered it before, strange...
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template