strip_whitespace() 函数返回已删除 PHP 注释以及空白字符的源代码文件。
该函数对于检测脚本中的实际代码量很有用。
strip_whitespace(filename)
参数 | 描述 |
---|---|
filename | 必需。规定文件名。 |
若成功,则返回被剥离的源代码,若失败,则返回空字符串。
"test.php":
<?php
// PHP comment
/*
*
Another PHP comment
*/
echo php_strip_whitespace
("test.php");
?>
输出:
<?php
echo php_strip_whitespace ("test.php"); ?>
©2020 IT自习室京ICP备20010815号