承接 php-dto/uri 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

php-dto/uri

最新稳定版本:0.1.0

Composer 安装命令:

composer require php-dto/uri

包简介

Immutable uri object with validation and helpful methods

README 文档

README

Installation

composer require php-dto/uri

Usage

<?php

$uri = new \PhpDto\Uri\Uri('https://foo@test.example.com:42?query#');

echo $uri->get(); //will print https://foo@test.example.com:42?query#
echo (string) $uri; //will print https://foo@test.example.com:42?query#

print_r($uri->getComponents());
//will print
array(
  'scheme' => 'https',           // the URI scheme component
  'user' => 'foo',              // the URI user component
  'pass' => null,               // the URI pass component
  'host' => 'test.example.com', // the URI host component
  'port' => 42,                 // the URI port component
  'path' => '',                 // the URI path component
  'query' => 'query',           // the URI query component
  'fragment' => '',             // the URI fragment component
);

new \PhpDto\Uri\Uri('http://test.com', ['https',]); //will throw \PhpDto\Uri\Exception\UriException (allows only `https` scheme)

统计信息

  • 总下载量: 2.87k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2022-11-10