I have some strings, some end by a language code with a trailing slash("xx/",can be "fr/", or "en/", or other ), some end by a number with trailing slash("int/", can be "2.0/" or "3.0/").
I want to remove the language code “xx/” if the string end with “xx/”, and do nothing if end with “int/”.
By substr($sring, -3), I can identify what is the final. But how to remove it if the final is “xx/”?
not tested