2017 © Pedro Peláez
 

library resolve_uri

Resolves relative urls, like a browser would

image

peterpostmann/resolve_uri

Resolves relative urls, like a browser would

  • Friday, November 17, 2017
  • by peterpostmann
  • Repository
  • 1 Watchers
  • 0 Stars
  • 24 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

resolve_uri

![Software License][ico-license] Build Status, (*1)

Resolves relative urls, like a browser would., (*2)

This function returns a new URI based on base path ([RFC3986][1] URL, URN, Windows path, relative path or file) and a new path., (*3)

Install

Via Composer

composer require peterpostmann/resolve_uri

If you dont want to use composer copy the resolve_uri.php file and from [peterpostmann\php-parse_uri][2] the parse_uri.php file and include it into your project., (*4)

Usage

use function peterpostmann\uri\resolve_uri;

string resolve_uri ( string basePath, string newPath) 

Example

parse URIs

use function peterpostmann\uri\resolve_uri;

echo resolve_uri('http://a/b/c/d;p?q#x',    'x')."\n";
echo resolve_uri('C:\path\file1.ext',       'file2.ext')."\n";
echo resolve_uri('file://smb/path/to/file', '/new/path/x.ext')."\n";

The above example will output:, (*5)

http://a/b/c/x
C:\path\file2.ext
file://smb/new/path/x.ext

License

The MIT License (MIT). Please see License File for more information., (*6)

The Versions

17/11 2017

dev-master

9999999-dev

Resolves relative urls, like a browser would

  Sources   Download

MIT

The Requires

 

The Development Requires

by Peter Postmann

17/11 2017

1.0.0

1.0.0.0

Resolves relative urls, like a browser would

  Sources   Download

MIT

The Requires

 

The Development Requires

by Peter Postmann