2017 © Pedro Peláez
 

library url

PHP Url manipulation library

image

alexeybob/url

PHP Url manipulation library

  • Tuesday, April 17, 2018
  • by alexeybob
  • Repository
  • 1 Watchers
  • 0 Stars
  • 21 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 62 % Grown

The README.md

PHP Url manipulation library.

Installation

$ composer require alexeybob/url dev-master

Example 1

$url = "http://username:password@hostname:9090/segment1/segment2/segment3/segment4/segment5/segment6?arg1=value1&arg2=value2&arg3=value3&arg4=value4&arg5=value5#anchor";

// result: https://alexeybob:123abc@test.com:9090/common/user/2?arg1=25&arg2=member#shop
echo aburl($url, [
    "scheme" => "https",
    "host" => "test.com",
    "port" => 9090,
    "user" => "alexeybob",
    "pass" => "123abc",
    "path" => [
        1 => 'common',
        2 => 'user',
        3 => 2,
        4 => null,
        5 => null,
        6 => null
    ],
    "query" => [
        "arg1" => 25,
        "arg2" => 'member',
        "arg3" => null,
        "arg4" => null,
        "arg5" => null,
    ],
    "fragment" => "shop"
]);

Example 2

$url = "http://username:password@hostname:9090/segment1/segment2/segment3/segment4/segment5/segment6?arg1=value1&arg2=value2&arg3=value3&arg4=value4&arg5=value5#anchor";

// result: https://alexeybob:123abc@test.com:9090/common/user/2?arg1=25&arg2=member#shop
echo aburl($url, [
    "scheme" => "https",
    "host" => "test.com",
    "port" => 9090,
    "user" => "alexeybob",
    "pass" => "123abc",
    "path" => '/common/user/2',
    "query" => "arg1=25&arg2=member",
    "fragment" => "shop"
]);

Example 3

$url = "http://username:password@hostname:9090/segment1/segment2/segment3/segment4/segment5/segment6?arg1=value1&arg2=value2&arg3=value3&arg4=value4&arg5=value5#anchor";

// result: https://test.com
echo aburl($url, [
    "scheme" => "https",
    "host" => "test.com",
    "port" => null,
    "user" => null,
    "pass" => null,
    "path" => null,
    "query" => null,
    "fragment" => null
]);

The Versions

17/04 2018

dev-master

9999999-dev

PHP Url manipulation library

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by Alexey Bob

16/04 2018

v1.0

1.0.0.0

PHP Url manipulation library

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by Alexey Bob