Can anyone tell me how I would remove a substring from the end of a string.
The string in question could have any one of three substrings at the end of it that need removed, so I wouldn't know in advance what the length was.
Like that? Or do you want it only replaced if it's at the end of the string? If you're looking for extensions, you might use the strrpos function and look for the '.' then use substr to remove everything after it.