Home > php教程 > php手册 > PHP正则表达式替换中文字符串

PHP正则表达式替换中文字符串

WBOY
Release: 2016-06-06 20:10:23
Original
1053 people have browsed it

mb_regex_encoding('utf-8'); $string = ' 中文 ; $outstr = mb_ereg_replace( [^ , 简体 , $string); echo $outstr; ?> 参考资料 http://www.php.net/manual/en/function.mb-ereg-replace.php 原文地址:PHP正则表达式替换中文字符串, 感谢原作者分享。

mb_regex_encoding('utf-8');

$string = '中文

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template