Home > php教程 > php手册 > 改进的htmlspecialchars

改进的htmlspecialchars

WBOY
Release: 2016-06-07 11:46:03
Original
1281 people have browsed it

改进的htmlspecialcharsfunction hsc($text){<br>     return preg_replace('/&((#(\d{3,5}|x[a-fA-F0-9]{4})|[a-zA-Z][a-z0-9]{2,5});)/', '&\\1',<br>            str_replace(array('&', '"', '',' '), array('&', '"', '', ' '), $text));<br> }

AD:真正免费,域名+虚机+企业邮箱=0元

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template