Remove trailing slash from comment form
- by Sergio Vargott
and i really need a code to remove the ending slash when a user put their link.
for example i need them to put their url to grab their avatar, but in some cases they put their url ending with a slash (.com/) how can i remove that slash automatically? because when they put their url like that the avatar doesn't show i need them to end like this (.com) in order to show their avatar.
I was looking for a remove trailing slash php code, but any solution will be appreciated.
i tried to use this code but didn't work
$string = rtrim($string, '/');