当前位置:网站首页>Learn how to use PHP to filter special symbols in strings
Learn how to use PHP to filter special symbols in strings
2022-06-24 10:35:00 【Wandering in memory of Yu Fei】
Learn to use php Method for filtering special symbols in strings
Filtration method
function filtrationStr($str){
$str = str_replace('`', '', $str);
$str = str_replace('·', '', $str);
$str = str_replace('~', '', $str);
$str = str_replace('!', '', $str);
$str = str_replace('!', '', $str);
$str = str_replace('@', '', $str);
$str = str_replace('#', '', $str);
$str = str_replace('$', '', $str);
$str = str_replace('¥', '', $str);
$str = str_replace('%', '', $str);
$str = str_replace('^', '', $str);
$str = str_replace('……', '', $str);
$str = str_replace('&', '', $str);
$str = str_replace('*', '', $str);
$str = str_replace('(', '', $str);
$str = str_replace(')', '', $str);
$str = str_replace('(', '', $str);
$str = str_replace(')', '', $str);
$str = str_replace('-', '', $str);
$str = str_replace('_', '', $str);
$str = str_replace('——', '', $str);
$str = str_replace('+', '', $str);
$str = str_replace('=', '', $str);
$str = str_replace('|', '', $str);
$str = str_replace('\\', '', $str);
$str = str_replace('[', '', $str);
$str = str_replace(']', '', $str);
$str = str_replace('【', '', $str);
$str = str_replace('】', '', $str);
$str = str_replace('{', '', $str);
$str = str_replace('}', '', $str);
$str = str_replace(';', '', $str);
$str = str_replace(';', '', $str);
$str = str_replace(':', '', $str);
$str = str_replace(':', '', $str);
$str = str_replace('\'', '', $str);
$str = str_replace('"', '', $str);
$str = str_replace('“', '', $str);
$str = str_replace('”', '', $str);
$str = str_replace(',', '', $str);
$str = str_replace(',', '', $str);
$str = str_replace('<', '', $str);
$str = str_replace('>', '', $str);
$str = str_replace('《', '', $str);
$str = str_replace('》', '', $str);
$str = str_replace('.', '', $str);
$str = str_replace('.', '', $str);
$str = str_replace('/', '', $str);
$str = str_replace('、', '', $str);
$str = str_replace('?', '', $str);
$str = str_replace('?', '', $str);
return trim($str);
}
Call the current method to filter special characters , Update when necessary
边栏推荐
- 包装类型的缓存机制
- 机械臂速成小指南(零):指南主要内容及分析方法
- 希尔排序图文详解+代码实现
- Common methods of thread scheduling
- 机械臂速成小指南(一):机械臂发展概况
- Normal equation
- Six states of threads
- Machine learning perceptron and k-nearest neighbor
- Quick completion guide for mechanical arm (I): development overview of mechanical arm
- Learning to organize using kindeditor rich text editor in PHP
猜你喜欢

leetCode-223: 矩形面积

Record the range of data that MySQL update will lock

【JS逆向分享】某个网站社区信息

Practice sharing of packet capturing tool Charles

Sort out interface performance optimization skills and kill slow code

Leetcode-498: diagonal traversal

Spark提交参数--files的使用

Quick completion guide for mechanical arm (II): application of mechanical arm

进程与多线程

Leetcode-223: rectangular area
随机推荐
26.删除有序数组的重复项
机械臂速成小指南(一):机械臂发展概况
Sort out interface performance optimization skills and kill slow code
Uniapp implements the function of clicking to make a call
23. Opencv——图像拼接项目
Appium automation test foundation - mobile end test environment construction (I)
126. 单词接龙 II BFS
1. project environment construction
[EI分享] 2022年第六届船舶,海洋与海事工程国际会议(NAOME 2022)
leetCode-929: 独特的电子邮件地址
2.登陆退出功能开发
[IEEE publication] 2022 International Conference on intelligent transportation and future travel (cstfm 2022)
Spark submission parameter -- use of files
2022 the most complete and detailed JMeter interface test tutorial and detailed interface test process in the whole network - JMeter test plan component (thread < user >)
栈题目:括号的分数
Appium自动化测试基础 — 移动端测试环境搭建(一)
【数据分析数据源】全国各省市行政区坐标(包含边界坐标点和中心坐标点)
JMeter接口测试工具基础— 取样器sampler(二)
JMeter interface test tool foundation - sampler (II)
Leetcode interview question 16.06: minimum difference