定制 bickmista/spurl 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

bickmista/spurl

最新稳定版本:0.3.1

Composer 安装命令:

composer require bickmista/spurl

包简介

A URL library that can validate, modify and split URL's. This library can split URL's into Subdomain, domain and TLD without choking when it comes to newer TLD's.

关键字:

README 文档

README

A URL manipulation library

Description

A PHP Library that can break down and build URLs into/from an array.

##Implementations

Current

  • Breakdown URLs
  • Build up URLs

Planned

  • Replace segments before build
  • Shuffle segments before build (e.g. swap host.domain with path.2)

Requirements

  • PHP 5.4+

Installation

Using Composer

To install Spurl with Composer, just add the following to your composer.json file

{
    "require": {
        "bickmista/spurl": "0.*"
    }
}

or by running the following command:

composer require bickmista/spurl

Usage

General

Shatter

To break down a URL into segments pass it into our shatter function.

$url = 'http://test.com/example/path?some=query#anchor';

$splitUrl = Spurl\Url::shatter($url);

The output from the shatter function in the example above would be

$splitUrl = [
  'protocol' => 'http',
  'host' => 'test.com',
  'path' => 'example/path',
  'query' => 'some=query',
  'anchor' => 'anchor'
];

You can also break down URLs further by passing true as an optional second parameter

$url = 'http://test.com/';

$splitUrl = Spurl\Url::shatter($url, true);

which would return

$splitUrl = [
  'protocol' => 'http',
  'host' => [
    'domain' => 'test',
    'suffix' => 'com'
  ]
];

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-08-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固