PHPackages                             jeremyelliot/urlhelper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. jeremyelliot/urlhelper

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

jeremyelliot/urlhelper
======================

Helper class for parsing URLs

v1.1.1(7y ago)09MITPHPPHP ^7.1.3

Since Oct 29Pushed 7y ago1 watchersCompare

[ Source](https://github.com/jeremyelliot/urlhelper)[ Packagist](https://packagist.org/packages/jeremyelliot/urlhelper)[ RSS](/packages/jeremyelliot-urlhelper/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (3)Versions (5)Used By (0)

UrlHelper
=========

[](#urlhelper)

UrlHelper is a wrapper class for parsing URLs. It provides a way to:

- get particular parts of the URL
- extract parts of the URL into a new valid URL.

UrlHelpers are immutable. When a UrlHelper is cast to string it will give the same string that was passed into the constructor.

The `get()` method is used for building a URL from the parts you have. The `getContextPart()` method will return the part of the url to which a relative URL would be appended by a web browser.

Examples
--------

[](#examples)

```
