library tools
Some simple method for often use
bbear/tools
Some simple method for often use
- Monday, June 4, 2018
- by hululidexiong
- Repository
- 1 Watchers
- 0 Stars
- 27 Installations
- PHP
- 2 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 4 Versions
- 23 % Grown
- 判断为空 isEmpty
- 分转换元 beforePrice 说明:返回值 乘 100
- 元转换分 lastPrice 说明:值 除 100 保留两位小数(末位会因精度导致四舍五入)
- 保留小数两位 (末位会因精度导致四舍五入) float2
- 分页 page
- 多结果分页 multiPage
- 按计时方式显示时间 secondToWords
- 验证是索引数组 is_indexArray
- 对称加密方法 sEncode
-
对称解密方法 sDecode, (*1)
isEmpty 接受一个值 同 empty不同的是 这个方法不会验证 0
page 分页 如下:, (*2)
```, (*3)
接收三个参数 int $count , int $page , int $pagesize
print_r( Tools::page(50 , 1) );
multiPage 等于page的升级版至此多结果集分页:
除第一个参数是数组 其他与page相同
$C = array();
$C[] = 12;
$C[] = 4;
$C[] = 20;
$C[] = 5;
print_r( Tools::multiPage($C , 1 , 50) );
secondToWords( second ) 接收一个 int 参数 返回:按计时方式显示时间
如:3分45秒
is_indexArray 验证数组是索引数组
## Installation
> 使用composer 安装
```shell
composer require "bbear/tools"
Usage
use BBear\Tools\Base\Tools;
$str = '~!@#$%^&*()_+ asdasdzxc啊哦哦';
$enStr = Tools::sEncode($str);
$deStr = Tools::sDecode($enStr);
echo $str . "\n";
echo $enStr . "\n";
echo $deStr . "\n";
var_dump( $str === $deStr);
dev-master
9999999-dev
Some simple method for often use
Sources
Download
MIT
LGPL
The Requires
by
BBear
v0.1.2
0.1.2.0
Some simple method for often use
Sources
Download
MIT
The Requires
by
BBear
v0.1.1
0.1.1.0
Some simple method for often use
Sources
Download
MIT
The Requires
by
BBear
v0.1.0
0.1.0.0
Some simple method for often use
Sources
Download
LGPL
The Requires
by
BBear