当前位置:网站首页>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
边栏推荐
- H5网页如何在微信中自定义分享链接
- 88. merge ordered arrays
- Baidu online disk download has been in the process of requesting solutions
- JMeter interface test tool foundation - badboy tool
- SSM integration
- Uniapp implements the function of clicking to make a call
- Leetcode-223: rectangular area
- Leetcode-929: unique email address
- 线程的 sleep() 方法与 wait() 方法的区别
- Common methods of thread scheduling
猜你喜欢

消息队列的作用

The difference between the sleep () method and the wait () method of a thread

26.删除有序数组的重复项

2022 International Symposium on intelligent robots and systems (isoirs 2022)

【Energy Reports期刊发表】2022年能源与环境工程国际会议(CFEEE 2022)

Uniapp develops a wechat applet to display the map function, and click it to open Gaode or Tencent map.

Leetcode-223: rectangular area

Machine learning perceptron and k-nearest neighbor

Leetcode-2221: triangular sum of arrays

6. package management business development
随机推荐
栈题目:函数的独占时间
283.移动零
Leetcode-929: unique email address
Distribute proofs of manuscripts by scanning
Illustration miscellaneous [for archiving to prevent loss]
[JS reverse sharing] community information of a website
leetCode-面试题 16.06: 最小差
牛客-TOP101-BM28
Multithreaded applications - improve efficiency
Baidu online disk download has been in the process of requesting solutions
88.合并有序数组
Role of message queuing
Normal equation
leetCode-1089: 复写零
numpy. logical_ or
1.项目环境搭建
pycharm快捷键大全
How can I solve the problem that the swiper animation animation fails when switching between left and right rotations of the swiper?
Thread pool execution process
Leetcode-1089: replication zero