PHP strip_whitespace() 函數

PHP Misc 參考手冊 PHP Misc 參考手冊

實例

返回已刪除 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 Misc 參考手冊 PHP Misc 參考手冊