dave            Tue Aug 10 19:28:15 2004 EDT

  Modified files:              
    /phpdoc/en/reference/misc/functions php-strip-whitespace.xml 
  Log:
  - Document php_strip_whitespace() with example.
  
  
http://cvs.php.net/diff.php/phpdoc/en/reference/misc/functions/php-strip-whitespace.xml?r1=1.1&r2=1.2&ty=u
Index: phpdoc/en/reference/misc/functions/php-strip-whitespace.xml
diff -u phpdoc/en/reference/misc/functions/php-strip-whitespace.xml:1.1 
phpdoc/en/reference/misc/functions/php-strip-whitespace.xml:1.2
--- phpdoc/en/reference/misc/functions/php-strip-whitespace.xml:1.1     Sun May  2 
11:46:21 2004
+++ phpdoc/en/reference/misc/functions/php-strip-whitespace.xml Tue Aug 10 19:28:14 
2004
@@ -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>
 

Reply via email to