PHP加密PHP文件代码方法 encode_file_contents

方法代码:

');
		$contents = substr($contents, $headerPos + 5, $footerPos - $headerPos);
		$encode = base64_encode(gzdeflate($contents)); // 开始编码
		$encode = '";

		return file_put_contents($filename, $encode);
	}
	return false;
}

?>

使用方法

//调用函数
$filename = 'test.php';    //需要加密的文件完整路径
encode_file_contents($filename);
echo "OK,加密完成!"

test.php原代码:

加密后

以上只是简单的文件加密,大家也可以参考以上方法完善和修改里面的加密规则

温馨提示: 本文最后更新于2024-12-31 21:01:29,某些文章具有时效性,若有错误或已失效,请在下方 留言或联系 蚂蚁官方
© 版权声明
THE END
喜欢就支持一下吧
点赞6赞赏 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容