2017 © Pedro Peláez
 

library think-helper

The ThinkPHP5 Helper Package

image

topthink/think-helper

The ThinkPHP5 Helper Package

  • Wednesday, April 5, 2017
  • by topthink
  • Repository
  • 6 Watchers
  • 40 Stars
  • 44,437 Installations
  • PHP
  • 45 Dependents
  • 0 Suggesters
  • 25 Forks
  • 5 Open issues
  • 6 Versions
  • 23 % Grown

The README.md

thinkphp5 常用的一些扩展类库

更新完善中, (*1)

以下类库都在\\think\\helper命名空间下, (*2)

Str

字符串操作, (*3)

// 检查字符串中是否包含某些字符串
Str::contains($haystack, $needles)

// 检查字符串是否以某些字符串结尾
Str::endsWith($haystack, $needles)

// 获取指定长度的随机字母数字组合的字符串
Str::random($length = 16)

// 字符串转小写
Str::lower($value)

// 字符串转大写
Str::upper($value)

// 获取字符串的长度
Str::length($value)

// 截取字符串
Str::substr($string, $start, $length = null)

Hash

创建密码的哈希, (*4)

// 创建
Hash::make($value, $type = null, array $options = [])

// 检查
Hash::check($value, $hashedValue, $type = null, array $options = [])

Time

时间戳操作, (*5)

// 今日开始和结束的时间戳
Time::today();

// 昨日开始和结束的时间戳
Time::yesterday();

// 本周开始和结束的时间戳
Time::week();

// 上周开始和结束的时间戳
Time::lastWeek();

// 本月开始和结束的时间戳
Time::month();

// 上月开始和结束的时间戳
Time::lastMonth();

// 今年开始和结束的时间戳
Time::year();

// 去年开始和结束的时间戳
Time::lastYear();

// 获取7天前零点到现在的时间戳
Time::dayToNow(7)

// 获取7天前零点到昨日结束的时间戳
Time::dayToNow(7, true)

// 获取7天前的时间戳
Time::daysAgo(7)

//  获取7天后的时间戳
Time::daysAfter(7)

// 天数转换成秒数
Time::daysToSecond(5)

// 周数转换成秒数
Time::weekToSecond(5)

The Versions

05/04 2017

dev-master

9999999-dev

The ThinkPHP5 Helper Package

  Sources   Download

Apache-2.0

by Avatar yunwuxin

05/04 2017

v1.0.6

1.0.6.0

The ThinkPHP5 Helper Package

  Sources   Download

Apache-2.0

by Avatar yunwuxin

01/12 2016

v1.0.5

1.0.5.0

The ThinkPHP5 Helper Package

  Sources   Download

Apache-2.0

by Avatar yunwuxin

30/11 2016

v1.0.4

1.0.4.0

The ThinkPHP5 Helper Package

  Sources   Download

Apache-2.0

by Avatar yunwuxin

13/07 2016

v1.0.3

1.0.3.0

The ThinkPHP5 Helper Package

  Sources   Download

Apache-2.0

by Avatar yunwuxin

03/06 2016

v1.0.2

1.0.2.0

The ThinkPHP5 Helper Package

  Sources   Download

Apache-2.0

by Avatar yunwuxin