How to replace all last occurrence of specific character of a string? for example if I want to replace all the characters (say "-") from the end of a sentence?
eg. "Hello world--- This is me----"
I only need the end all "-" characters to be removed, so string will finally be just
"Hello world--- This is me"
Is there a php function like trim() or please suggest how can I do this?