PHP strip_whitespace() 函数

PHP 教程 · 2019-01-27 14:27:34

实例

返回已删除 PHP 注释以及空白字符的 "test.php" 文件的源代码:

<?php
// PHP comment

/*
* Another PHP comment
*/

echo php_strip_whitespace ("test.php");
?>

如果您在浏览器窗口选择"查看源代码",则如下所示:

<?php
echo php_strip_whitespace ("test.php"); ?>

定义和用法

strip_whitespace() 函数返回已删除 PHP 注释以及空白字符的源代码文件。

语法

strip_whitespace(filename)

参数 描述
filename 必需。规定文件名。

技术细节

返回值: 如果成功则返回已删除 PHP 注释以及空白字符的源代码,如果失败则返回空。注释:在 PHP 5.0.1 之前的版本,该函数只返回空字符串。
PHP 版本: 5+

点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html

查看所有标签

Once Upon an Algorithm

Once Upon an Algorithm

Martin Erwig / MIT Press / 2017-9-8 / GBP 22.95

How Hansel and Gretel, Sherlock Holmes, the movie Groundhog Day, Harry Potter, and other familiar stories illustrate the concepts of computing. Picture a computer scientist, staring at a screen and......一起来看看 《Once Upon an Algorithm》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具