I'm trying to check for a plus sign using PHP and regular expressions.
Here is the code I got so far.
preg_replace('#[^-a-zA-Z0-9_&; ]#', '', $abcd)
您可能只需要使用反斜杠转义加号: \\+
。
在列表中添加一个+。
preg_replace('#[^-a-zA-Z0-9_&; +]#', '', $abcd)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.