public static function cleanPath($path)
    {
        $regex = '/(\/)\/+/';
        $path = str_replace(['\\', '/ /'], '/', $path);
        $path = preg_replace($regex,'$1',$path);

        return $path;
    }
public static function cleanPath($path)
    {
        $regex = '/(\/)\/+/';
        $path = str_replace(['\\', '/ /'], '/', $path);
        $path = preg_replace($regex,'$1',$path);

        return $path;
    }
public static function cleanPath ( $ path ) { $ regex = '/(\/)\/+/' ; $ path = str_replace ( [ '\\' , '/ /' ] , '/' , $ path ) ; $ path = preg_replace ( $ regex , '$1' , $ path ) ; return $ path ; }
Removes extra double slashes and fixes back-slashes

@param string $path
@return mixed|string
Removes extra double slashes and fixes back - slashes