scholte/uri 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

scholte/uri

Composer 安装命令:

composer require scholte/uri

包简介

RFC 3986 PHP URI extension

README 文档

README

This object follows the PSR-7 HTTP message described at http://www.php-fig.org/psr/psr-7/ and RFC 3986. Every URI has a specific construction as shown below:

tel:+31-123-456-789
urn:oasis:names:specification:docbook:dtd:xml:4.1.2
ftp://ftp.is.co.za/rfc/rfc1808.txt
mailto:John.Doe@example.com
scheme:[//[user:password@]host[:port]][/]path[?query][#fragment]
  1. Protocol: scheme
  2. Authentication: user:password
  3. Domain: www.host.com
  4. Port: 80
  5. Path: /path
  6. Query: ?parameter=value
  7. Fragment: #fragment

Installation

This package can be installed using composer:

$ composer require scholte/uri

How to use

The URI object can be used for all RFC 3986 URI's. It is possible to change or extract specific parts of the URI without having to search and replace those parts.

<?php
use Scholte\Uri;

$uri = new Uri('scheme://user:password@www.host.com:80/path?parameter=value#fragment');
echo $uri->setScheme('https')->getUri(URI_STRIP_FRAGMENT);
// Output: https://user:password@www.host.com/path?parameter=value

$uri = new Uri('http://www.host.com/path');
echo $uri->getUri(URI_STRIP_SCHEME|URI_STRIP_HOST);
// Output: /path

About

Dependencies

  • Works with PHP 7.1 or higher
  • psr/http-message ^1.0

Author

Christiaan Scholte - cscholte_83@hotmail.com

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2017-07-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固