Home > Backend Development > PHP Tutorial > PHP code encryption -- php_strip_whitespace function, removes all comments and spaces from the source code and displays it on one line

PHP code encryption -- php_strip_whitespace function, removes all comments and spaces from the source code and displays it on one line

WBOY
Release: 2016-08-08 09:27:48
Original
1134 people have browsed it

//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.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template