This isn't a question, but more of a challenge (very easy though).
I was playing with some code and trying to do what I wanted without loading the regex engine and came up with this:
Can anyone tell me what the corresponding regex is?
I wonder whether it is any faster than a regex.
I was playing with some code and trying to do what I wanted without loading the regex engine and came up with this:
Code:
substr($url, rindex($url, '/'), (length($url) - rindex($url, '/'))) = undef;Can anyone tell me what the corresponding regex is?
I wonder whether it is any faster than a regex.