Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to remove special letters from php regular

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you how to remove special letters from php rules. I hope you will get something after reading this article. Let's discuss it together.

Php regular to achieve the removal of special letters: 1, to create a PHP example file; 2, through "$str = preg_replace ($ddd,'',$str);" to remove special characters.

This article operating environment: Windows7 system, PHP7.1 version, Dell G3 computer.

Php regularizes the removal of Chinese, Chinese characters and special characters

Regular removal of Chinese, Chinese characters, special characters:

$str = '432.65456787rewqrewq6 my xff'; $ddd = "/ [',:; *? ~ `! @ # $% ^ & + =) ({}] |\] |\ [|\" |\ | / "; $cc ='/ [\ x80 -\ xff] {0,} /'; $qq =" / [a-zA-Z] + / "; $str = preg_replace ($ddd,'',$str); $str = preg_replace ($qq,'',$str) $str = preg_replace ($cc,'',$str); echo $str; after reading this article, I believe you have a certain understanding of "how to remove special letters from php rules". If you want to know more about it, welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report