Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP php_strip_whitespace() Function

PHP php_strip_whitespace() Function

PHP Misc Reference Manual PHP Misc Reference Manual

Example

Return the source code of the "test.php" file with PHP comments and whitespace removed:

If you select "View Source" in the browser window, it looks like this:


Definition and Usage

The php_strip_whitespace() function returns source code with PHP comments and whitespace removed.


Syntax

php_strip_whitespace(

filename

)

Parameters Description
filename Required. Specifies the filename.

Technical Details

Return Value: On success, returns the source code with PHP comments and whitespace removed; on failure, returns nothing. **Note:** Prior to PHP 5.0.1 this function only returned an empty string.
PHP Version: 5+

PHP Misc Reference Manual PHP Misc Reference Manual