mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
fix pr: 7763
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@35604 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
775c542081
commit
2a9bedc61b
1 changed files with 22 additions and 0 deletions
|
@ -2425,6 +2425,28 @@ echo str_repeat ("-=", 10);
|
|||
</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
|
||||
|
|
Loading…
Reference in a new issue