onursimsek/unparse-url

Reverse parsed url

v1.0 2024-02-07 14:28 UTC

This package is auto-updated.

Last update: 2024-10-11 11:36:40 UTC


README

Latest Version on Packagist Total Downloads

Installation

You can install the package via composer:

composer require onursimsek/unparse-url

Usage

This package reverses parse_url() result. Here's a demo of how you can use it:

$parsedUrl = parse_url('https://github.com/onursimsek/unparse-url');
/*[
    "scheme" => "https",
    "host" => "github.com",
    "path" => "/onursimsek/unparse-url",
]*/

echo new UnparseUrl\UnparseUrl($parsedUrl);
// https://github.com/onursimsek/unparse-url

You can use helper function.

$parsedUrl = [
    'scheme' => 'https',
    'host' => 'github.com',
    'path' => '/onursimsek/unparse-url',
];

echo unparse_url($parsedUrl);
// https://github.com/onursimsek/unparse-url