Home > Backend Development > PHP Tutorial > php将标点符号替换为空格

php将标点符号替换为空格

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-23 13:47:47
Original
1402 people have browsed it

php用正则匹配将符号替换为空格

<?php $character = "!@#$%^&*中'文中'文中'文().,<>|[]'\":;}{-_+=?/abcdefgh中'文ijklmnopqrstuvwx中'文yzABCDEFGHI中文JKLMNOPQRSTUVWXYZ~`中'文文文文文";$reg = "/[[:punct:]]/i";$character = preg_replace($reg, '', $character);print_r($character);die;?>
Copy after login



source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template