Skip to content

PHP lightweight library to parse malformed or incomplete urls.

License

Notifications You must be signed in to change notification settings

pjpawel/parse-url

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parse-url

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()

About

PHP lightweight library to parse malformed or incomplete urls.

Resources

License

Stars

Watchers

Forks

Languages