1 '); 12 $contents = substr($contents, $headerPos + 5, $footerPos - $headerPos); 13 $encode = base64_encode(gzdeflate($contents)); // 开始编码 14 $encode = ' "; 15 16 return file_put_contents($filename, $encode); 17 } 18 return false; 19 } 20 21 //调用函数 22 $filename = './test.php'; 23 encode_file_contents($filename); 24 echo "OK,加密完成!";25 ?>