php过滤汉字的有关问题

WBOY
Release: 2016-06-13 12:08:17
Original
990 people have browsed it

php过滤汉字的问题
老师:小明到了吗。班长:小明肚子痛,请假半天。老师:王磊干什么去了。班长:王磊请事假2天。老师:陈华没来吗?班长:陈华到学生回去了。
我想把老师提问过滤掉。只留下:班长:小明肚子痛,请假半天。班长:王磊请事假2天。班长:陈华到学生回去了。

这样php代码怎么写。
------解决思路----------------------

$s = '老师:小明到了吗。班长:小明肚子痛,请假半天。老师:王磊干什么去了。班长:王磊请事假2天。老师:陈华没来吗?班长:陈华到学生回去了。';<br /><br />echo preg_replace('/老师:.+(班长.+)/U', '$1', $s);<br />
Copy after login
班长:小明肚子痛,请假半天。班长:王磊请事假2天。班长:陈华到学生回去了。

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