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! 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. 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
Archived
This topic is now archived and is closed to further replies.