Jeffro Posted November 11, 2011 Share Posted November 11, 2011 I know this one is probably super easy for you programmer types.. but I just need to know.. If a string ends with a dash (and not all of them will), how do I remove it? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/250916-how-do-i-remove-a-dash-on-the-end-of-a-string-if-it-exists/ Share on other sites More sharing options...
Jeffro Posted November 11, 2011 Author Share Posted November 11, 2011 Nevermind.. got it. $string = rtrim($string, '-'); ....seems to do the trick. Quote Link to comment https://forums.phpfreaks.com/topic/250916-how-do-i-remove-a-dash-on-the-end-of-a-string-if-it-exists/#findComment-1287268 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.