pjpawel/parse-url

Lightweight library to parse non-standard urls and standard too

v1.1.0 2022-05-09 12:24 UTC

This package is auto-updated.

Last update: 2024-10-27 15:37:33 UTC


README

PHP lightweight library to parse non-standard urls and standard urls too!

Latest Version on Packagist

Installation

composer require pjpawel/parse-url

Actual list of conversion

Comparison with parse_url() -> Conversions

Basic usage

Full usage you will find here -> Wiki

<?php

use pjpawel\UrlParser;

$url = "www.malformed_url.com";

$parsedUrl = UrlParser::parse($url);
var_dump($parsedUrl);
/*
array(1) {
  ["host"]=>
  string(21) "www.malformed_url.com"
}
 */

echo UrlParser::createUrl($parsedUrl)
/*
www.malformed_url.com
 */

Output array of URL::parse() is the same as parse_url()