Home > Backend Development > PHP Tutorial > 正则替换请问

正则替换请问

WBOY
Release: 2016-06-13 13:41:53
Original
737 people have browsed it

正则替换请教!



如何将上面 中间的部分用正则替换成

------解决方案--------------------
中间不含div的话

$str = preg_replace("/
.*/ims","
",$str);

自己测试一下
------解决方案--------------------
$str = preg_replace("/
.*/ims",'',$str);
------解决方案--------------------
探讨

$str = preg_replace("/
.*/ims",'',$str);
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