Home > php教程 > PHP源码 > PHP中多字节字符的preg_match_all

PHP中多字节字符的preg_match_all

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-08 17:23:54
Original
1338 people have browsed it

本文章给大家介绍PHP中多字节字符的preg_match_all实例,大家可参考。

<script>ec(2);</script>
 代码如下 复制代码

function mb_ereg_match_all($pattern, $subject, array &$subpatterns)
{
if(!mb_ereg_search_init($subject, $pattern)) // 初期化?I理
return false;
$subpatterns = array();
while($r = mb_ereg_search_regs()) { // 初期化?I理で?定したパタ?ンと文字列から?仕?br /> $subpatterns[] = $r;
}
return true;
}

$pattern = ‘[^s ]+’;
$subject = ‘你好, 吃了么。 我吃 的包子加油条。’;
mb_ereg_match_all($pattern, $subject, $result);
print_r($result);

Related labels:
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