substr returns a section of a string from another string. One of the most typical uses is to find the rest of the string after some flag character's position in the string, which itself is found using strpos.
Here's one application of the function from a larger class
The delimiter constant is "_". So, given "mypath_key" this function will return "key". Given a string that doesn't include the delimiter, the delimiter is returned directly. The +1 here assumes the delimiter is a single character - technically it should be strlen(self::DELIMITER) to not break if someone changes the delimiter to something with multiple characters.
Another example off PHP.net that returns the string between two other strings within a string using substr
Substr gets used a lot in string manipulation - Anyone else have some examples, comments, questions?