Home  >  Article  >  php教程  >  改进的htmlspecialchars

改进的htmlspecialchars

WBOY
WBOYOriginal
2016-06-07 11:46:031227browse

改进的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元

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