定制 misantron/php-utils 二次开发

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

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

misantron/php-utils

最新稳定版本:2.0.0

Composer 安装命令:

composer require misantron/php-utils

包简介

A collection of PHP utility classes.

README 文档

README

Build Status Code Coverage Code Climate Latest Release

Features

  • Contains Array, String and Time helper utilities.
  • Base encoding - UTF-8
  • PSR-4 auto loading standard compatible.

Server requirements

  • PHP version >= 5.4.
  • MBString PHP extension.
  • OpenSSL PHP extension.

External dependencies

Installing

The preferred way to install is through Composer. Run this command to install the latest stable version:

$ composer require misantron/php-utils

or add

"misantron/php-utils": "dev-master"

to the require section of your composer.json.

Basic usage examples

use Utility\UArray;  
use Utility\UString;  
use Utility\UTime;

$array = [  
    ['name' => 'Alex', 'age' => 25],  
    ['name' => 'Sara', 'age' => 21],  
    ['name' => 'John', 'age' => 28]  
];  
$string = '..C’est du français !';  
$date1 = new \DateTime('2015-02-26 13:05');  
$date2 = new \DateTime('2015-02-26 22:16');  

$result1 = UArray::extractColumn($array, 'age');  
$result2 = UString::slug($string);  
$result3 = UTime::secondsDiff($date1, $date2);

var_dump($result1, $result2, $result3);

[25, 21, 28];  
'c-est-du-francais';  
33060;

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-02-26