Home > Article > Backend Development > php filters special characters such as slashes
$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.