正文
PHP strip_whitespace() 函数
小程序:扫一扫查出行
【扫一扫了解最新限行尾号】
复制小程序
【扫一扫了解最新限行尾号】
复制小程序
实例
返回已删除 PHP 注释以及空白字符的 "test.php" 文件的源代码:
<?php
// PHP comment
// PHP comment
/*
* Another PHP comment
*/高佣联盟 www.cgewang.com
echo php_strip_whitespace ("test.php");
?>
如果您在浏览器窗口选择"查看源代码",则如下所示:
<?php
echo php_strip_whitespace ("test.php"); ?>
echo php_strip_whitespace ("test.php"); ?>
定义和用法
strip_whitespace() 函数返回已删除 PHP 注释以及空白字符的源代码文件。
语法
strip_whitespace(
filename
)
strip_whitespace(
filename
)
参数 | 描述 |
---|---|
filename | 必需。规定文件名。 |
技术细节
返回值: | 如果成功则返回已删除 PHP 注释以及空白字符的源代码,如果失败则返回空。 注释: 在 PHP 5.0.1 之前的版本,该函数只返回空字符串。 |
---|---|
PHP 版本: | 5+ |