Function : to_dotspace

This function performs three operations. It converts frontslashes or dots to backslash, removes a trailing front or back slashes suffix from the end of a url and decides if a prefix trailing slash is to be added to the supplied url. This in simple terms means that any url supplied is converted to a namespace pattern with or without a prefix trailing backslash.

Syntax
  to_dotspace($url, $dots)
   
  $url  : supplied url string
  $prefix : a boolean value of true adds a backslash prefix
   
                  
Sample 1
  $text = to_dotspace('some/url.foo'); 

  var_dump( $text ); // some\url\foo  
                  
Sample 2
  $text = to_dotspace('some/url.foo/', true); 

  var_dump( $text ); // \some\url\foo  
                  
To prevent dots from being converted to backslash see to_namespace documentation.