strip_whitespace
PHP strip_whitespace() 函数
定义和用法
strip_whitespace() 函数返回已删除 PHP 注释以及空白字符的源代码文件。
该函数对于检测脚本中的实际代码量很有用。
语法
seover" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
1 | strip_whitespace(filename) |
参数 | 描述 |
---|---|
filename | 必需。规定文件名。 |
说明
若成功,则返回被剥离的源代码,若失败,则返回空字符串。
注释:在 PHP 5.0.1,该函数的行为与上面的描述一致。在这之前,它仅返回空字符串。
例子
"test.php":
1 | <?php // PHP comment /* * Another PHP comment */ echo php_strip_whitespace ("test.php"); ?> |
输出:
1 | <?php echo php_strip_whitespace ("test.php"); ?> |
未经允许不得转载:淘淘源码吧 » strip_whitespace