string php_strip_whitespace ($file)Parameters:php_strip_whitespace function() takes one parameter $file. This is a required parameter and specifies the file.Returned value:Returns the original $file after removing comments and spaces on success, otherwise returns an empty string.Exceptions :
- It works on PHP 5.0.1 and later, it returns an empty string in previous versions.
- This function works similarly to the php -wcommand line.
Program:
// Simple program for remove comments
// using the php_strip_whitespace function.
// function for calculating the number Fibonacci
function
fib (
$n
)
{
if
(
$n
< = 1)
return
$n
;
return
fib ( $n
- 1) + fib (
$n
- 2);
}
// Driver code
$n
= 9;
fib (
$n
);
/ *
* Another multi-line comment
* /
echo
php_strip_whitespace (
__ FILE__
);
// This line is also removed
?>
Exit: Link: http: //php.net/manual/en/function.php-strip-whitespace.php