Home  >  Article  >  Backend Development  >  How to implement source code encryption in php

How to implement source code encryption in php

小云云
小云云Original
2017-11-08 10:02:451794browse

Method one:

\'.$'.$q1.'($'.$q3.'($'.$q4.'($'.$q2.',$'.$q5.'*2),$'.$q4.'($'.$q2.',$'.$q5.',$'.$q5.'),$'.$q4.'($'.$q2.',0,$'.$q5.'))));').'"));';
 $s='';
 echo $s;
 //生成 加密后的PHP文件
 !is_dir('create/') && mkdir('create/');
 $fpp1 = fopen('create/'.$filename,'w');
 fwrite($fpp1,$s) or die('写文件错误');
 echo '加密成功!';

Method two:

');  
         $contents = substr($contents, $headerPos + 5, $footerPos - $headerPos);  
         $encode = base64_encode(gzdeflate($contents)); // 开始编码  
         $encode = '";   
 
         return file_put_contents($filename, $encode);  
     }  
     return false;  
 }   
 
 //调用函数  
 $filename = 'dam.php';  
 encode_file_contents($filename);  
 echo "OK,加密完成!" 
 ?>

The above is the detailed content of How to implement source code encryption in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn