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

正则替换请问

WBOY
WBOYOriginal
2016-06-13 10:14:07832browse

正则替换请教!



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

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

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

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

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