热搜:NVER node 开发 php

php将标点符号替换为空格

2024-08-20 11:45:01
php将标点符号替换为空格

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

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