Remove Double Slashes from URL without Breaking It

If you need to clean up a URL and remove any double (or more) slashes that might have crept in, but need to keep the :// bit intact you might like this little function

    protected function removeDoubleSlash($in) {
        return preg_replace('%([^:])(

Handy :)


Tags: replacephpslashregexurlpregdoubleclean