Menu Home

php_strip_whitespace

osbo.com | PHP | Functions | php_strip_whitespace

Return source with stripped comments and whitespace

Syntax

php_strip_whitespace ( string $filename ) : string

Parameters

filename

Path to the PHP file.

Return

The stripped source code will be returned on success, or an empty string on failure.

Note: This function respects the value of the short_open_tag ini directive.

Examples

<?

// PHP comment

/*
 * Another PHP comment
 */

// newlines are considered whitespace




echo        php_strip_whitespace(__FILE__);

?>
<? echo php_strip_whitespace(__FILE__); ?>

PHP