mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
- Document php_strip_whitespace() with example.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@165982 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
4635f020c6
commit
5a7d3c7d8f
1 changed files with 48 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<refentry id="function.php-strip-whitespace">
|
||||
<refnamediv>
|
||||
<refname>php_strip_whitespace</refname>
|
||||
|
@ -8,13 +8,57 @@
|
|||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>php_strip_whitespace</methodname>
|
||||
<methodparam><type>string</type><parameter>file_name</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
&warn.undocumented.func;
|
||||
<para>
|
||||
Returns the PHP source code in <parameter>filename</parameter> 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.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
The stripped source code will be returned on success, or an empty string
|
||||
on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>php_strip_whitespace</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// PHP comment here
|
||||
|
||||
/*
|
||||
* Another PHP comment
|
||||
*/
|
||||
|
||||
echo php_strip_whitespace($_SERVER['PHP_SELF']);
|
||||
// Newlines are considered whitespace, and are removed too:
|
||||
do_nothing();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
<?php
|
||||
echo php_strip_whitespace($_SERVER['PHP_SELF']); do_nothing(); ?>
|
||||
]]>
|
||||
</screen>
|
||||
<para>
|
||||
Notice the PHP comments are gone, as are the whitespace and newline
|
||||
after the first echo statement.
|
||||
</para>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
|
Loading…
Reference in a new issue