PHP: php_strip_whitespace - Manual in Deutsh
PHP: php_strip_whitespace - Manual in French
PHP: php_strip_whitespace - Manual in Polish

You Are At PHP: php_strip_whitespace - Manual Area


recent searches:
include functions , variable functions , post functions...




If you are new to PHP or just need to refresh your skills, this is the place to start. This series of tutorials will give you the basic knowledge you will need to create a simple PHP website.

PHP is a reflective programming language originally designed for producing dynamic web pages.[1] PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications. Textual User Interfaces can also be created using ncurses.

PHP Manual
PrevNext

php_strip_whitespace

(PHP 5)

php_strip_whitespace -- Return source with stripped comments and whitespace

Description

string php_strip_whitespace ( string filename )

Returns the PHP source code in filename with PHP comments and whitespace removed. This may be useful for determining the amount of actual code in your scripts compared with the amount of comments. This is similar to using php -w from the commandline.

Parameters

filename

Path to the PHP file.

Return Values

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

Note: This function works as described as of PHP 5.0.1. Before this it would only return an empty string. For more information on this bug and its prior behavior, see bug report #29606.

Examples

Example 1. php_strip_whitespace() example

<?php
// PHP comment here

/*
* Another PHP comment
*/

echo        php_strip_whitespace(__FILE__);
// Newlines are considered whitespace, and are removed too:
do_nothing();
?>

The above example will output:

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

Notice the PHP comments are gone, as are the whitespace and newline after the first echo statement.

Jak ograniczyć jedzenie słodyczy Jak ograniczyć jedzenie słodyczy
6
www.finansowo.podejrzliwy.kalisz.pl
Prezenty
tanie holowanie Rzeszów

Another Useful functions:


streams.struct-php-stream-wrapper | streams.struct-php-stream-wrapper-ops | streams.struct-php-stream-statbuf | streams.struct-php-stream-ops | streams.struct-php-stream-filter | streams.struct-php-stream-filter-ops | streams.struct-php-stream-dirent | streams.php-stream-write | streams.php-stream-tell | streams.php-stream-stat | streams.php-stream-stat-path | streams.php-stream-sock-open-unix | streams.php-stream-sock-open-host | streams.php-stream-sock-open-from-socket | streams.php-stream-seek | streams.php-stream-rewinddir | streams.php-stream-readdir | streams.php-stream-read | streams.php-stream-passthru | streams.php-stream-opendir | streams.php-stream-open-wrapper | streams.php-stream-open-wrapper-ex | streams.php-stream-open-wrapper-as-file | streams.php-stream-make-seekable | streams.php-stream-is | streams.php-stream-is-persistent | streams.php-stream-gets | streams.php-stream-getc | streams.php-stream-fopen-tmpfile | streams.php-stream-fopen-temporary-file | streams.php-stream-fopen-from-file | streams.php-stream-flush | streams.php-stream-filter-unregister-factory | streams.php-stream-filter-register-factory | streams.php-stream-eof | streams.php-stream-copy-to-stream | streams.php-stream-copy-to-mem | streams.php-stream-closedir | streams.php-stream-close | streams.php-stream-cast | streams.php-stream-can-cast | function.php-strip-whitespace | function.php-sapi-name |


PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. If you are new to PHP and want to get some idea of how it works, try the introductory tutorial. After that, check out the online manual, and the example archive sites and some of the other resources available in the links section.