ddliu/normurl

Normalize URL

v0.1.1 2014-11-05 10:15 UTC

This package is auto-updated.

Last update: 2024-04-13 21:19:31 UTC


README

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.