irchtml         Wed Feb 25 05:19:06 2004 EDT

  Modified files:              
    /phpdoc/en/reference/ctype/functions        ctype-alnum.xml 
                                                ctype-alpha.xml 
                                                ctype-cntrl.xml 
                                                ctype-digit.xml 
                                                ctype-graph.xml 
                                                ctype-lower.xml 
                                                ctype-print.xml 
                                                ctype-punct.xml 
                                                ctype-space.xml 
                                                ctype-upper.xml 
                                                ctype-xdigit.xml 
  Log:
  Added ctype examples
  
http://cvs.php.net/diff.php/phpdoc/en/reference/ctype/functions/ctype-alnum.xml?r1=1.3&r2=1.4&ty=u
Index: phpdoc/en/reference/ctype/functions/ctype-alnum.xml
diff -u phpdoc/en/reference/ctype/functions/ctype-alnum.xml:1.3 
phpdoc/en/reference/ctype/functions/ctype-alnum.xml:1.4
--- phpdoc/en/reference/ctype/functions/ctype-alnum.xml:1.3     Tue Oct 21 04:40:23 
2003
+++ phpdoc/en/reference/ctype/functions/ctype-alnum.xml Wed Feb 25 05:19:05 2004
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
 <!-- splitted from ./en/functions/ctype.xml, last change in rev 1.1 -->
   <refentry id="function.ctype-alnum">
    <refnamediv>
@@ -19,6 +19,34 @@
      equivalent to <literal>preg_match('/^[a-z0-9]*$/i', $text)</literal>.
     </para>
     <para>
+     <example>
+      <title>A <function>ctype_alnum</function> example (using the default 
locale)</title>
+      <programlisting role="php">
+<![CDATA[
+<?php
+$strings = array('AbCd1zyZ9', 'foo!#$bar');
+foreach ($strings as $testcase) {
+    if (ctype_alnum($testcase)) {
+        echo "The string $testcase consists of all letters or digits.\n";
+    } else {
+        echo "The string $testcase does not consist of all letters or digits.\n";
+    }
+}
+?>
+]]>
+      </programlisting>
+      <para>
+       This example will output :
+      </para>
+      <screen>
+<![CDATA[
+The string AbCd1zyZ9 consists of all letters or digits.
+The string foo!#$bar does not consists of all letters or digits.
+]]>
+      </screen>
+     </example>
+    </para>
+    <para>
      See also <function>ctype_alpha</function>, <function>ctype_digit</function>, 
      and <function>setlocale</function>.
     </para>
http://cvs.php.net/diff.php/phpdoc/en/reference/ctype/functions/ctype-alpha.xml?r1=1.3&r2=1.4&ty=u
Index: phpdoc/en/reference/ctype/functions/ctype-alpha.xml
diff -u phpdoc/en/reference/ctype/functions/ctype-alpha.xml:1.3 
phpdoc/en/reference/ctype/functions/ctype-alpha.xml:1.4
--- phpdoc/en/reference/ctype/functions/ctype-alpha.xml:1.3     Mon Oct 27 13:37:35 
2003
+++ phpdoc/en/reference/ctype/functions/ctype-alpha.xml Wed Feb 25 05:19:05 2004
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
 <!-- splitted from ./en/functions/ctype.xml, last change in rev 1.1 -->
   <refentry id="function.ctype-alpha">
    <refnamediv>
@@ -22,6 +22,34 @@
      are considered neither upper nor lower case.
     </para>
     <para>
+     <example>
+      <title>A <function>ctype_alpha</function> example (using the default 
locale)</title>
+      <programlisting role="php">
+<![CDATA[
+<?php
+$strings = array('KjgWZC', 'arf12');
+foreach ($strings as $testcase) {
+    if (ctype_alpha($testcase)) {
+        echo "The string $testcase consists of all letters.\n";
+    } else {
+        echo "The string $testcase does not consist of all letters.\n";
+    }
+}
+?>
+]]>
+      </programlisting>
+      <para>
+       This example will output :
+      </para>
+      <screen>
+<![CDATA[
+The string KjgWZC consists of all letters.
+The string arf12 does not consists of all letters.
+]]>
+      </screen>
+     </example>
+    </para>
+    <para>
      See also <function>ctype_upper</function>,
      <function>ctype_lower</function>, and
      <function>setlocale</function>.
http://cvs.php.net/diff.php/phpdoc/en/reference/ctype/functions/ctype-cntrl.xml?r1=1.2&r2=1.3&ty=u
Index: phpdoc/en/reference/ctype/functions/ctype-cntrl.xml
diff -u phpdoc/en/reference/ctype/functions/ctype-cntrl.xml:1.2 
phpdoc/en/reference/ctype/functions/ctype-cntrl.xml:1.3
--- phpdoc/en/reference/ctype/functions/ctype-cntrl.xml:1.2     Wed Apr 17 02:37:03 
2002
+++ phpdoc/en/reference/ctype/functions/ctype-cntrl.xml Wed Feb 25 05:19:05 2004
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
 <!-- splitted from ./en/functions/ctype.xml, last change in rev 1.1 -->
   <refentry id="function.ctype-cntrl">
    <refnamediv>
@@ -17,6 +17,34 @@
      a special control function, &false; otherwise. Control characters are
      e.g. line feed, tab, esc.
     </para>
+    <para>
+     <example>
+      <title>A <function>ctype_cntrl</function> example</title>
+      <programlisting role="php">
+<![CDATA[
+<?php
+$strings = array('string1' => "\n\r\t", 'string2' => 'arf12');
+foreach ($strings as $name => $testcase) {
+    if (ctype_cntrl($testcase)) {
+        echo "The string '$name' consists of all control characters.\n";
+    } else {
+        echo "The string '$name' does not consist of all control characters.\n";
+    }
+}
+?>
+]]>
+      </programlisting>
+      <para>
+       This example will output :
+      </para>
+      <screen>
+<![CDATA[
+The string 'string1' consists of all control characters.
+The string 'string2' does not consists of all control characters.
+]]>
+      </screen>
+     </example>
+    </para>
    </refsect1>
   </refentry>
 
http://cvs.php.net/diff.php/phpdoc/en/reference/ctype/functions/ctype-digit.xml?r1=1.2&r2=1.3&ty=u
Index: phpdoc/en/reference/ctype/functions/ctype-digit.xml
diff -u phpdoc/en/reference/ctype/functions/ctype-digit.xml:1.2 
phpdoc/en/reference/ctype/functions/ctype-digit.xml:1.3
--- phpdoc/en/reference/ctype/functions/ctype-digit.xml:1.2     Wed Apr 17 02:37:03 
2002
+++ phpdoc/en/reference/ctype/functions/ctype-digit.xml Wed Feb 25 05:19:05 2004
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
 <!-- splitted from ./en/functions/ctype.xml, last change in rev 1.1 -->
   <refentry id="function.ctype-digit">
    <refnamediv>
@@ -17,6 +17,35 @@
      a decimal digit, &false; otherwise.
     </para>
     <para>
+     <example>
+      <title>A <function>ctype_digit</function> example</title>
+      <programlisting role="php">
+<![CDATA[
+<?php
+$strings = array('1820.20', '10002', 'wsl!12');
+foreach ($strings as $testcase) {
+    if (ctype_digit($testcase)) {
+        echo "The string $testcase consists of all digits.\n";
+    } else {
+        echo "The string $testcase does not consist of all digits.\n";
+    }
+}
+?>
+]]>
+      </programlisting>
+      <para>
+       This example will output :
+      </para>
+      <screen>
+<![CDATA[
+The string 1820.20 does not consists of all digits.
+The string 10002 consists of all digits.
+The string wsl!12 does not consists of all digits.
+]]>
+      </screen>
+     </example>
+    </para>
+    <para>
      See also <function>ctype_alnum</function> and <function>ctype_xdigit</function>.
     </para>
    </refsect1>
http://cvs.php.net/diff.php/phpdoc/en/reference/ctype/functions/ctype-graph.xml?r1=1.2&r2=1.3&ty=u
Index: phpdoc/en/reference/ctype/functions/ctype-graph.xml
diff -u phpdoc/en/reference/ctype/functions/ctype-graph.xml:1.2 
phpdoc/en/reference/ctype/functions/ctype-graph.xml:1.3
--- phpdoc/en/reference/ctype/functions/ctype-graph.xml:1.2     Wed Apr 17 02:37:03 
2002
+++ phpdoc/en/reference/ctype/functions/ctype-graph.xml Wed Feb 25 05:19:05 2004
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
 <!-- splitted from ./en/functions/ctype.xml, last change in rev 1.1 -->
   <refentry id="function.ctype-graph">
    <refnamediv>
@@ -18,6 +18,35 @@
      otherwise.
     </para>
     <para>
+     <example>
+      <title>A <function>ctype_graph</function> example</title>
+      <programlisting role="php">
+<![CDATA[
+<?php
+$strings = array('string1' => "asdf\n\r\t", 'string2' => 'arf12', 'string3' => 
'[EMAIL PROTECTED]');
+foreach ($strings as $name => $testcase) {
+    if (ctype_graph($testcase)) {
+        echo "The string '$name' consists of all (visibly) printable characters.\n";
+    } else {
+        echo "The string '$name' does not consist of all (visibly) printable 
characters.\n";
+    }
+}
+?>
+]]>
+      </programlisting>
+      <para>
+       This example will output :
+      </para>
+      <screen>
+<![CDATA[
+The string 'string1' does not consist of all printable characters.
+The string 'string2' consists of all printable characters.
+The string 'string3' consists of all printable characters.
+]]>
+      </screen>
+     </example>
+    </para>
+    <para>
      See also <function>ctype_alnum</function>, <function>ctype_print</function>,
      and <function>ctype_punct</function>.
     </para>
http://cvs.php.net/diff.php/phpdoc/en/reference/ctype/functions/ctype-lower.xml?r1=1.2&r2=1.3&ty=u
Index: phpdoc/en/reference/ctype/functions/ctype-lower.xml
diff -u phpdoc/en/reference/ctype/functions/ctype-lower.xml:1.2 
phpdoc/en/reference/ctype/functions/ctype-lower.xml:1.3
--- phpdoc/en/reference/ctype/functions/ctype-lower.xml:1.2     Wed Apr 17 02:37:03 
2002
+++ phpdoc/en/reference/ctype/functions/ctype-lower.xml Wed Feb 25 05:19:05 2004
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
 <!-- splitted from ./en/functions/ctype.xml, last change in rev 1.1 -->
   <refentry id="function.ctype-lower">
    <refnamediv>
@@ -17,7 +17,37 @@
      a lowercase letter in the current locale.
     </para>
     <para>
-     See also <function>ctype_alpha</function> and <function>ctype_upper</function>.
+     <example>
+      <title>A <function>ctype_lower</function> example (using the default 
locale)</title>
+      <programlisting role="php">
+<![CDATA[
+<?php
+$strings = array('aac123', 'qiutoas', 'QASsdks');
+foreach ($strings as $testcase) {
+    if (ctype_lower($testcase)) {
+        echo "The string $testcase consists of all lowercase letters.\n";
+    } else {
+        echo "The string $testcase does not consist of all lowercase letters.\n";
+    }
+}
+?>
+]]>
+      </programlisting>
+      <para>
+       This example will output :
+      </para>
+      <screen>
+<![CDATA[
+The string aac123 does not consist of all lowercase letters.
+The string qiutoas consists of all lowercase letters.
+The string QASsdks does not consist of all lowercase letters.
+]]>
+      </screen>
+     </example>
+    </para>
+    <para>
+     See also <function>ctype_alpha</function>, <function>ctype_upper</function>,
+     and <function>setlocale</function>.
     </para>
    </refsect1>
   </refentry>
http://cvs.php.net/diff.php/phpdoc/en/reference/ctype/functions/ctype-print.xml?r1=1.2&r2=1.3&ty=u
Index: phpdoc/en/reference/ctype/functions/ctype-print.xml
diff -u phpdoc/en/reference/ctype/functions/ctype-print.xml:1.2 
phpdoc/en/reference/ctype/functions/ctype-print.xml:1.3
--- phpdoc/en/reference/ctype/functions/ctype-print.xml:1.2     Wed Apr 17 02:37:03 
2002
+++ phpdoc/en/reference/ctype/functions/ctype-print.xml Wed Feb 25 05:19:05 2004
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
 <!-- splitted from ./en/functions/ctype.xml, last change in rev 1.1 -->
   <refentry id="function.ctype-print">
    <refnamediv>
@@ -19,6 +19,35 @@
      that do not have any output or control function at all.
     </para>
     <para>
+     <example>
+      <title>A <function>ctype_print</function> example</title>
+      <programlisting role="php">
+<![CDATA[
+<?php
+$strings = array('string1' => "asdf\n\r\t", 'string2' => 'arf12', 'string3' => 
'[EMAIL PROTECTED]');
+foreach ($strings as $name => $testcase) {
+    if (ctype_print($testcase)) {
+        echo "The string '$name' consists of all printable characters.\n";
+    } else {
+        echo "The string '$name' does not consist of all printable characters.\n";
+    }
+}
+?>
+]]>
+      </programlisting>
+      <para>
+       This example will output :
+      </para>
+      <screen>
+<![CDATA[
+The string 'string1' does not consist of all printable characters.
+The string 'string2' consists of all printable characters.
+The string 'string3' consists of all printable characters.
+]]>
+      </screen>
+     </example>
+    </para>
+    <para>
      See also <function>ctype_cntrl</function>, <function>ctype_graph</function>,
      and <function>ctype_punct</function>.
     </para>
http://cvs.php.net/diff.php/phpdoc/en/reference/ctype/functions/ctype-punct.xml?r1=1.2&r2=1.3&ty=u
Index: phpdoc/en/reference/ctype/functions/ctype-punct.xml
diff -u phpdoc/en/reference/ctype/functions/ctype-punct.xml:1.2 
phpdoc/en/reference/ctype/functions/ctype-punct.xml:1.3
--- phpdoc/en/reference/ctype/functions/ctype-punct.xml:1.2     Wed Apr 17 02:37:03 
2002
+++ phpdoc/en/reference/ctype/functions/ctype-punct.xml Wed Feb 25 05:19:06 2004
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
 <!-- splitted from ./en/functions/ctype.xml, last change in rev 1.1 -->
   <refentry id="function.ctype-punct">
    <refnamediv>
@@ -20,8 +20,36 @@
      is printable, but neither letter, digit or blank, &false; otherwise.
     </para>
     <para>
-     See also <function>ctype_cntrl</function>, <function>ctype_graph</function>,
-     and <function>ctype_punct</function>.
+     <example>
+      <title>A <function>ctype_punct</function> example</title>
+      <programlisting role="php">
+<![CDATA[
+<?php
+$strings = array('[EMAIL PROTECTED]', '!@ # $', '*&$()');
+foreach ($strings as $testcase) {
+    if (ctype_punct($testcase)) {
+        echo "The string $testcase consists of all punctuation.\n";
+    } else {
+        echo "The string $testcase does not consist of all punctuation.\n";
+    }
+}
+?>
+]]>
+      </programlisting>
+      <para>
+       This example will output :
+      </para>
+      <screen>
+<![CDATA[
+The string [EMAIL PROTECTED] does not consist of all punctuation.
+The string !@ # $ does not consist of all punctuation.
+The string *&$() consists of all punctuation.
+]]>
+      </screen>
+     </example>
+    </para>
+    <para>
+     See also <function>ctype_cntrl</function> and <function>ctype_graph</function>.
     </para>
    </refsect1>
   </refentry>
http://cvs.php.net/diff.php/phpdoc/en/reference/ctype/functions/ctype-space.xml?r1=1.2&r2=1.3&ty=u
Index: phpdoc/en/reference/ctype/functions/ctype-space.xml
diff -u phpdoc/en/reference/ctype/functions/ctype-space.xml:1.2 
phpdoc/en/reference/ctype/functions/ctype-space.xml:1.3
--- phpdoc/en/reference/ctype/functions/ctype-space.xml:1.2     Wed Apr 17 02:37:03 
2002
+++ phpdoc/en/reference/ctype/functions/ctype-space.xml Wed Feb 25 05:19:06 2004
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
 <!-- splitted from ./en/functions/ctype.xml, last change in rev 1.1 -->
   <refentry id="function.ctype-space">
    <refnamediv>
@@ -18,6 +18,39 @@
      blank character this also includes tab, vertical tab, line feed,
      carriage return and form feed characters.
     </para>
+    <para>
+     <example>
+      <title>A <function>ctype_space</function> example</title>
+      <programlisting role="php">
+<![CDATA[
+<?php
+$strings = array('string1' => "\n\r\t", 'string2' => "\narf12", 'string3' => 
'\n\r\t');
+foreach ($strings as $name => $testcase) {
+    if (ctype_space($testcase)) {
+        echo "The string '$name' consists of all whitespace characters.\n";
+    } else {
+        echo "The string '$name' does not consist of all whitespace characters.\n";
+    }
+}
+?>
+]]>
+      </programlisting>
+      <para>
+       This example will output :
+      </para>
+      <screen>
+<![CDATA[
+The string 'string1' consists of all whitespace characters.
+The string 'string2' does not consist of all whitespace characters.
+The string 'string3' does not consist of all whitespace characters.
+]]>
+      </screen>
+     </example>
+    </para>
+    <para>
+     See also <function>ctype_cntrl</function>, <function>ctype_graph</function>,
+     and <function>ctype_punct</function>.
+    </para>
    </refsect1>
   </refentry>
 
http://cvs.php.net/diff.php/phpdoc/en/reference/ctype/functions/ctype-upper.xml?r1=1.3&r2=1.4&ty=u
Index: phpdoc/en/reference/ctype/functions/ctype-upper.xml
diff -u phpdoc/en/reference/ctype/functions/ctype-upper.xml:1.3 
phpdoc/en/reference/ctype/functions/ctype-upper.xml:1.4
--- phpdoc/en/reference/ctype/functions/ctype-upper.xml:1.3     Sun Jun 15 06:14:18 
2003
+++ phpdoc/en/reference/ctype/functions/ctype-upper.xml Wed Feb 25 05:19:06 2004
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
 <!-- splitted from ./en/functions/ctype.xml, last change in rev 1.1 -->
   <refentry id="function.ctype-upper">
    <refnamediv>
@@ -17,7 +17,37 @@
      an uppercase letter in the current locale.
     </para>
     <para>
-     See also <function>ctype_alpha</function> and <function>ctype_lower</function>.
+     <example>
+      <title>A <function>ctype_upper</function> example (using the default 
locale)</title>
+      <programlisting role="php">
+<![CDATA[
+<?php
+$strings = array('AKLWC139', 'LMNSDO', 'akwSKWsm');
+foreach ($strings as $testcase) {
+    if (ctype_upper($testcase)) {
+        echo "The string $testcase consists of all uppercase letters.\n";
+    } else {
+        echo "The string $testcase does not consist of all uppercase letters.\n";
+    }
+}
+?>
+]]>
+      </programlisting>
+      <para>
+       This example will output :
+      </para>
+      <screen>
+<![CDATA[
+The string AKLWC139 does not consist of all uppercase letters.
+The string LMNSDO consists of all uppercase letters.
+The string akwSKWsm does not consist of all uppercase letters.
+]]>
+      </screen>
+     </example>
+    </para>
+    <para>
+     See also <function>ctype_alpha</function>, <function>ctype_lower</function>,
+     and <function>setlocale</function>.
     </para>
    </refsect1>
   </refentry>
http://cvs.php.net/diff.php/phpdoc/en/reference/ctype/functions/ctype-xdigit.xml?r1=1.2&r2=1.3&ty=u
Index: phpdoc/en/reference/ctype/functions/ctype-xdigit.xml
diff -u phpdoc/en/reference/ctype/functions/ctype-xdigit.xml:1.2 
phpdoc/en/reference/ctype/functions/ctype-xdigit.xml:1.3
--- phpdoc/en/reference/ctype/functions/ctype-xdigit.xml:1.2    Wed Apr 17 02:37:03 
2002
+++ phpdoc/en/reference/ctype/functions/ctype-xdigit.xml        Wed Feb 25 05:19:06 
2004
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
 <!-- splitted from ./en/functions/ctype.xml, last change in rev 1.1 -->
   <refentry id="function.ctype-xdigit">
    <refnamediv>
@@ -20,6 +20,35 @@
      <literal>[A-Fa-f]</literal> , &false; otherwise.
     </para>
     <para>
+     <example>
+      <title>A <function>ctype_xdigit</function> example</title>
+      <programlisting role="php">
+<![CDATA[
+<?php
+$strings = array('AB10BC99', 'AR1012', 'ab12bc99');
+foreach ($strings as $testcase) {
+    if (ctype_xdigit($testcase)) {
+        echo "The string $testcase consists of all hexadecimal digits.\n";
+    } else {
+        echo "The string $testcase does not consist of all hexadecimal digits.\n";
+    }
+}
+?>
+]]>
+      </programlisting>
+      <para>
+       This example will output :
+      </para>
+      <screen>
+<![CDATA[
+The string AB10BC99 consists of all hexadecimal digits.
+The string AR1012 does not consist of all hexadecimal digits.
+The string ab12bc99 consists of all hexadecimal digits.
+]]>
+      </screen>
+     </example>
+    </para>
+    <para>
      See also <function>ctype_digit</function>.
     </para>
    </refsect1>

Reply via email to