public function removeTrainingSlash($url)
    {
        if (null === $url || strlen($url) <= 2) {
            return $url;
        }

        return (substr($url, -1, 1) == '/')? substr($url, 0, -1) : $url;
    }
public function removeTrainingSlash($url)
    {
        if (null === $url || strlen($url) <= 2) {
            return $url;
        }

        return (substr($url, -1, 1) == '/')? substr($url, 0, -1) : $url;
    }
public function removeTrainingSlash ( $ url ) { if ( null === $ url || strlen ( $ url ) <= 2 ) { return $ url ; } return ( substr ( $ url , - 1 , 1 ) == '/' ) ? substr ( $ url , 0 , - 1 ) : $ url ; }
Removes a trailing slash from an url string.

@param string $url
@return string
Removes a trailing slash from an url string .