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

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

WBOY
WBOYOriginal
2016-06-06 20:10:231053browse

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 = '中文

Statement:
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