I have some URLs, like www.amazon.com/, www.digg.com or www.microsoft.com/ and I want to remove the trailing slash, if it exists, so not j
www.amazon.com/
www.digg.com
www.microsoft.com/
Simple and works across both Windows and Unix:
$url = rtrim($url, '/\\')