Home  >  Article  >  Backend Development  >  php filters special characters such as slashes

php filters special characters such as slashes

WBOY
WBOYOriginal
2016-07-30 13:31:071788browse


$ArrFilters=array("'","<",">","x{5c}");

function IsExistStrings($SrcString, $ArrFilters){
foreach ($ArrFilters as $key=>$value){
                                                             ;
}

The string that needs to be filtered is as long as Just put it in the $ArrFilters array. Some of the special characters cannot be expressed or are escape characters. Then you need to enter the ASCII code input method such as "x{5c}" in the array $ArrFilters, where "5c" is the ASCII code of the slash, and the same is true for other characters! Unicode codes are also possible.

Copyright Statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission.

The above introduces the filtering of special characters such as slashes in PHP, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

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