ddliu/normurl

Normalize URL


License
MIT

Documentation

normurl

Normalize URL.

Features

  • Resolve relative URL
  • Remove anchor
  • Remove dot segment
  • Convert scheme and host name to lower case (TODO)

Installation

composer require ddliu\normurl

Usage

use ddliu\normurl\Url;

echo Url::normalize('../hello/world.html', 'http://example.com/about/index.html');
// http://example.com/hello/world.html

License

MIT

This project is based on url_to_absolute by David R. Nadeau.