Skip to content

Instantly share code, notes, and snippets.

@zsmynl
Created January 20, 2014 09:58
Show Gist options
  • Save zsmynl/8517650 to your computer and use it in GitHub Desktop.
Save zsmynl/8517650 to your computer and use it in GitHub Desktop.
过滤掉以“/开头”和“结束/”之间的字符串;
<?php
$str = '哈哈,开头我是被过滤的垃圾内容结束我才是要显示的内容一,开头我是被过滤的垃圾内容结束我才是要显示的内容二';
echo $str = preg_replace("/开头.*?结束/", '', $str);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment