cvs: phpdoc /en/functions strings.xml
| From: | Jani Taskinen | Date: | Sun, 12 Nov 2000 03:57:21 +0000 |
| Subject: | cvs: phpdoc /en/functions strings.xml | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969332868@lists.php.net to get a copy of this message | ||
sniper Sat Nov 11 19:57:21 2000 EDT
Modified files:
/phpdoc/en/functions strings.xml
Log:
fix pr: 7763
Index: phpdoc/en/functions/strings.xml
diff -u phpdoc/en/functions/strings.xml:1.63 phpdoc/en/functions/strings.xml:1.64
--- phpdoc/en/functions/strings.xml:1.63 Fri Oct 27 07:47:18 2000
+++ phpdoc/en/functions/strings.xml Sat Nov 11 19:57:21 2000
@@ -2425,6 +2425,28 @@
</para>
<para>
If <parameter>needle</parameter> is not found, returns false.
+ <note>
+ <para>
+ It is easy to mistake the return values for "character found at
+ position 0" and "character not found". Here's how to detect
+ the difference:
+ <informalexample>
+ <programlisting role="php">
+// in PHP 4.0b3 and newer:
+$pos = strrpos ($mystring, "b");
+if ($pos === false) { // note: three equal signs
+ // not found...
+}
+
+// in versions older than 4.0b3:
+$pos = strrpos ($mystring, "b");
+if (is_string ($pos) && !$pos) {
+ // not found...
+}
+ </programlisting>
+ </informalexample>
+ </para>
+ </note>
</para>
<para>
If <parameter>needle</parameter> is not a string, it is converted