PHPackages                             noccylabs/url - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. noccylabs/url

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

noccylabs/url
=============

Makes working with URLs easier

0.1.3(5y ago)023GPL-3.0PHP

Since Jun 29Pushed 5y ago1 watchersCompare

[ Source](https://github.com/noccy80/php-url)[ Packagist](https://packagist.org/packages/noccylabs/url)[ RSS](/packages/noccylabs-url/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (5)Used By (0)

URL
===

[](#url)

Installing
----------

[](#installing)

With composer:

```
    $ composer require noccylabs/url:0.1.*

```

Using
-----

[](#using)

### To canonize URLs

[](#to-canonize-urls)

If you have an input URL that may not be fully canonized, pass it through the `Url::canonizeUrl()` static method:

```
    $ugly = "google.com";
    $pretty = Url::canonizeUrl($ugly, "https");
    echo $pretty; // apply($image)->getUrl();
    echo $image_url; // setHost("google.com");
    $qs = new QueryString();
    $qs->set("q", "Hello World");
    $url->query = $qs;
    echo $url; //
