svn: /phpdoc/en/trunk/reference/strings/functions/ strcspn.xml
| From: | Philip Olson | Date: | Tue, 10 Aug 2010 17:37:37 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/strings/functions/ strcspn.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-6980@lists.php.net to get a copy of this message | ||
philip Tue, 10 Aug 2010 17:37:37 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=302077
Log:
Added example to clarify behavior. Closes PHP bug #52509
Bug: http://bugs.php.net/52509 (Assigned) strcspn() docs are
not clear
Changed paths:
U phpdoc/en/trunk/reference/strings/functions/strcspn.xml
Modified: phpdoc/en/trunk/reference/strings/functions/strcspn.xml
===================================================================
--- phpdoc/en/trunk/reference/strings/functions/strcspn.xml 2010-08-10 15:24:19 UTC (rev 302076)
+++ phpdoc/en/trunk/reference/strings/functions/strcspn.xml 2010-08-10 17:37:37 UTC (rev 302077)
@@ -94,6 +94,37 @@
</para>
</refsect1>
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <example xml:id="strcspn.example">
+ <title><function>strcspn</function> example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$a = strcspn('abcd', 'apple');
+$b = strcspn('abcd', 'banana');
+$c = strcspn('hello', 'l');
+$d = strcspn('hello', 'world');
+
+var_dump($a);
+var_dump($b);
+var_dump($c);
+var_dump($d);
+?>
+]]>
+ </programlisting>
+ &example.outputs;
+ <screen>
+<![CDATA[
+int(0)
+int(0)
+int(2)
+int(2)
+]]>
+ </screen>
+ </example>
+ </refsect1>
+
<refsect1 role="notes">
&reftitle.notes;
¬e.bin-safe;