Return the source code of the "test.php" file with the PHP comments and whitespace characters removed:
<?php// PHP comment/** Another PHP comment*/echo php_strip_whitespace ("test.php");?>If you select "View Source" in your browser window, it will look like this:
<?phpecho php_strip_whitespace ("test.php"); ?>The strip_whitespace() function returns the source code file with PHP comments and whitespace characters removed.
strip_whitespace( filename )
parameter | describe |
---|---|
filename | Required. Specifies the file name. |
Return value: | Returns the source code with PHP comments and whitespace characters removed on success, or null on failure. Note: In versions prior to PHP 5.0.1, this function only returned the empty string. |
---|---|
PHP version: | 5+ |