//Open all directories of files
$dir = "./tp/Home/Lib/Action/" ;
if ( $handle = opendir ( $dir )) {
while ( false !== ( $file = readdir ( $handle ))) {
if ( $file != "." && $file != ".." ) {
F echo $ file. '& Lt; br /& gt;'; 中 // Remove all comments and spaces in the file$ newfile = php_strip_whitespace ($ dir. $ File);
file_put_contents ('./ TP/Home/NewAction/'. Basename ($ file), $ n ewfile);
}
closedir ( $handle );
}
?>
The above introduces the PHP code encryption - php_strip_whitespace function, which removes all comments and spaces from the source code and displays it on one line, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.