original_string: protected function makeUriRelativeTo($uri, $root)
      {
          if (!$root) {
              return $uri;
          }
  
          if (is_array($uri)) {
              $uris = [];
              foreach ($uri as $u) {
                  $uris[] = $this->makeUriRelativeTo($u, $root);
              }
              return $uris;
          }
  
          if (substr($uri, 0, 1) === '/' || preg_match('/^([a-zA-Z]+:\/\/|[a-zA-Z]:\/|[a-zA-Z]:\\\)/', $uri)) {
              return $uri;
          }
          return rtrim($root, '/') . "/$uri";
      }
code: protected function makeUriRelativeTo($uri, $root)
      {
          if (!$root) {
              return $uri;
          }
  
          if (is_array($uri)) {
              $uris = [];
              foreach ($uri as $u) {
                  $uris[] = $this->makeUriRelativeTo($u, $root);
              }
              return $uris;
          }
  
          if (substr($uri, 0, 1) === '/' || preg_match('/^([a-zA-Z]+:\/\/|[a-zA-Z]:\/|[a-zA-Z]:\\\)/', $uri)) {
              return $uri;
          }
          return rtrim($root, '/') . "/$uri";
      }
code_tokens: protected function makeUriRelativeTo ( $ uri , $ root ) { if ( ! $ root ) { return $ uri ; } if ( is_array ( $ uri ) ) { $ uris = [ ] ; foreach ( $ uri as $ u ) { $ uris [ ] = $ this -> makeUriRelativeTo ( $ u , $ root ) ; } return $ uris ; } if ( substr ( $ uri , 0 , 1 ) === '/' || preg_match ( '/^([a-zA-Z]+:\/\/|[a-zA-Z]:\/|[a-zA-Z]:\\\)/' , $ uri ) ) { return $ uri ; } return rtrim ( $ root , '/' ) . "/$uri" ; }
docstring: Makes a URI relative to another
  
  @param string|array $uri
  @param string $root
  @return string
docstring_tokens: Makes a URI relative to another