file_get_contents和strstr防止文件关键内容被删除

如何判断文件内容删除,采用file_get_contents获取文件内容并转化为一个字符串,然后strstr判断是否为空即可。

$filecontent = file_get_contents('domain.php');
if (strstr($filecontent, '保哥后院') == "") {
	die ('请尊重版权');
}

posted on 2019-05-05 12:48  漏刻有时  阅读(19)  评论(0)    收藏  举报