go to bug id or search bugs for
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
Add a Pull Request
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.