These functions seem to be along the line of what you're looking for:
- strrpos
Find the position of the last occurrence of a substring in a string - substr
Return part of a string
So, you could use strpos
to find where the last .
character occurs in the string example.org/some_file.zip
, and then use substr
to get the part of the string that comes after that character (which would be zip
in this case).
Hope that helps!