#22884 [Com]: something strange with strchr
| From: | michael dot mauch at gmx dot de | Date: | Wed, 26 Mar 2003 10:09:57 +0000 |
| Subject: | #22884 [Com]: something strange with strchr | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-36455@lists.php.net to get a copy of this message | ||
ID: 22884
Comment by: michael dot mauch at gmx dot de
Reported By: sebastien at mouzaia dot com
Status: Bogus
Bug Type: Unknown/Other Function
Operating System: linux
PHP Version: 4.3.1
New Comment:
Does your copy of the manual also have the sentence:
If needle contains more than one character, the first is used.
Previous Comments:
------------------------------------------------------------------------
[2003-03-26 02:52:11] sebastien at mouzaia dot com
Hello Moriyoshisan
I know the manual by hart :-)
I read in it:
This function returns the portion of haystack which starts at the last
occurrence of needle and goes until the end of haystack.
In my sample, it prints "wings" if I use the word "drawings" and what
is expected, "/wip/drazings" if I use the word "drazings". This is not
a bug ?
Thanks for your consideration.
------------------------------------------------------------------------
[2003-03-25 18:06:08] moriyoshi@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
See http://www.php.net/manual/en/function.strrchr.php.
As described in the documentation, strrchr() doesn't work in the
opposite way of strchr().
------------------------------------------------------------------------
[2003-03-25 17:49:59] sebastien at mouzaia dot com
<?
print(phpversion().'<br>');
$string = "public_html/concepts/2L_vuda_dupont/wip/drawings";
$return = strrchr($string,'wip/');
print($return.'<br>'); // print wings WHY ???
print("<hr>");
$string = "public_html/concepts/2L_vuda_dupont/wip/drazings";
$return = strrchr($string,'wip/'); // print /wip/drazings(OK)
print($return.'<br>')
// tested on a 4.3.1 linux and on a 4.3.0 windows
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22884&edit=1