|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #67915 Improve strrchr
Submitted: 2014-08-27 14:14 UTC Modified: -
Avg. Score:1.7 ± 0.9
Reproduced:1 of 2 (50.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: contact at mathiasstrasser dot com Assigned:
Status: Open Package: *General Issues
PHP Version: 5.6.0RC4 OS: All
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: contact at mathiasstrasser dot com
New email:
PHP Version: OS:


 [2014-08-27 14:14 UTC] contact at mathiasstrasser dot com

I would like to know if is that possible to add a new argument in a
function strrchr ?
To do the same things of strstr.

strrchr ( string $haystack , mixed $needle [, bool $before_needle = false
] )

If TRUE, strrchr() returns the part of the haystack before the first
occurrence of the needle (excluding the needle).

Actually i'm forced to write:

substr ( $haystack, 0, strrpos ( $haystack, $needle ) )


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-09-08 10:01 UTC] mkurczew at gmail dot com
This would break SRP for PHP more than it currently is and creating yet another built-in function for this would unnecessarily pollute global namespace. Instead of complicating things more by introducing functions/arguments out of the blue, we should endeavor to simplify things. I'm against this.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Aug 04 21:01:24 2021 UTC