Home > Article > Backend Development > How to implement source code encryption in php
Method one:
\'.$'.$q1.'($'.$q3.'($'.$q4.'($'.$q2.',$'.$q5.'*2),$'.$q4.'($'.$q2.',$'.$q5.',$'.$q5.'),$'.$q4.'($'.$q2.',0,$'.$q5.'))));').'"));'; $s=' '.$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!