function formatUrl($url)
    {
        if (! $this->isUrl($url)) {
            return null;
        }
        $url = trim($url);
        $url = str_replace(' ', '+', $url);
        $parse = parse_url($url);
        strtolower($parse['scheme']);
        strtolower($parse['host']);
        return $this->buildUrl($parse);
    }
function formatUrl($url)
    {
        if (! $this->isUrl($url)) {
            return null;
        }
        $url = trim($url);
        $url = str_replace(' ', '+', $url);
        $parse = parse_url($url);
        strtolower($parse['scheme']);
        strtolower($parse['host']);
        return $this->buildUrl($parse);
    }
function formatUrl ( $ url ) { if ( ! $ this -> isUrl ( $ url ) ) { return null ; } $ url = trim ( $ url ) ; $ url = str_replace ( ' ' , '+' , $ url ) ; $ parse = parse_url ( $ url ) ; strtolower ( $ parse [ 'scheme' ] ) ; strtolower ( $ parse [ 'host' ] ) ; return $ this -> buildUrl ( $ parse ) ; }
Clean up and format

@param string $url
@return string|null
Clean up and format