没有什么是完美的。如果您只想要一些东西来阻止非程序员,那么下面是我编写的一个脚本,您可以使用:<?php
$infile=$_SERVER['argv'][1];$outfile=$_SERVER['argv'][2];if (!$infile || !$outfile) {
die("Usage: php {$_SERVER['argv'][0]} \n");}echo "Processing $infile to $outfile\n";$data="ob_end_clean();?>";
$data.=php_strip_whitespace($infile);
// compress data
$data=gzcompress($data,9);
// encode in base64
$data=base64_encode($data);
// generate output text
$out='<?ob_start ();$a=\''.$data.'\';eval(gzuncompress(base64_decode($a)));$v=ob_get_contents();ob_end_clean();?>';
// write output text
file_put_contents($outfile,$out);