我一直在寻找一个小时的解决方案,使用PHP脚本删除文件中的文本块.
似乎有许多选项可以删除文本行,但不能删除文本块.我试图使用preg_replace ("/^$start.*?$end/s", $replace, $fdata)以下,但没有找到一个有效的解决方案.
我确信有人已经这样做了,所以任何帮助都会非常感激.
$start = "# Copyright 2000-";
$end = "Agreement.";
# This software product may only be used strictly in accordance
# with the applicable written License Agreement.
Run Code Online (Sandbox Code Playgroud) php ×1