Re: [PHP-DEV] strrchr with needle with multiple characters

2024-09-19 Thread Tim Düsterhus
Hi Am 2024-09-02 15:24, schrieb Christoph M. Becker: Now, comparing strstr() and strrchr() is of course still possible, but different behavior is less astonishing. Of course, strrchr() could warn or even throw if $needle has more than one character, but that may unnecessarily break code for a

Re: [PHP-DEV] strrchr with needle with multiple characters

2024-09-02 Thread Christoph M. Becker
On 02.09.2024 at 13:17, Vincent Langlet wrote: > I was today old when I discovered the big difference between strchr and > strrchr in the way they handle needle with multiple characters. > > It's explained in the doc https://www.php.net/manual/en/function.strrchr.php > - If needle contains more th

Re: [PHP-DEV] strrchr with needle with multiple characters

2024-09-02 Thread David CARLIER
Hi, On Mon, 2 Sept 2024 at 12:20, Vincent Langlet wrote: > I was today old when I discovered the big difference between strchr and > strrchr in the way they handle needle with multiple characters. > > It's explained in the doc > https://www.php.net/manual/en/function.strrchr.php > - If needle co

[PHP-DEV] strrchr with needle with multiple characters

2024-09-02 Thread Vincent Langlet
I was today old when I discovered the big difference between strchr and strrchr in the way they handle needle with multiple characters. It's explained in the doc https://www.php.net/manual/en/function.strrchr.php - If needle contains more than one character, only the first is used. This behavior i