Latest web development tutorials

PHP strip_whitespace () function

PHP Misc Reference Manual PHP Misc Reference Manual

Examples

Return Deleted PHP comments and whitespace "test.php" file in the source code:

<?php
// PHP comment

/*
* Another PHP comment
*/

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

If you "view source" in the browser window selected, as follows:

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


Definition and Usage

strip_whitespace () function returns the deleted source code files PHP comments and whitespace.


grammar

strip_whitespace( filename )

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

technical details

return value: If successful deleted PHP comments and whitespace source code, if it fails to return empty. Note: In previous versions of PHP 5.0.1, this function only returns an empty string.
PHP version: 5+


PHP Misc Reference Manual PHP Misc Reference Manual