2017 © Pedro Peláez
 

libary create-order-length-php

image

medz/create-order-length-php

  • Wednesday, November 16, 2016
  • by medz
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

create-order-length-php

Build Status StyleCI, (*1)

概述

这个包是用于生成指定字符队中再指定长度内的所有不重复组合, (*2)

获取?

  • Composer: composer require medz/create-order-length-php, (*3)

  • source code: 下载这个包,并在你的加载中includebootstrap.php即可., (*4)

如何使用:

<?php

use Medz\Component\CreateOrderLength;

// 用于存储实例中生成的数据
$arr = array();

// 构造方法中支持快速设置需要的各个参数。
// $cls = new CreateOrderLength([int $length = 1 | array [int $lrngth = 1, bool $isStaticLength = false]], array $keys = [...]);
$cls = new CreateOrderLength();

// 设置生成的最大长度
// $cls->setLength(int $length, [bool $isStaticLength = false])
$cls->setLength(3);

// 设置回调方法,传入匿名函数
$cls->setCallable(function ($str) use (&$arr) {
  array_push($arr, $str);
});

// 设置用于生成字符串的字符组合
// 默认值是a-z0-9
// $cls->setKeys(array(...))

// 开始生成
// 支持设置前置字符串,前置字符串将会被计算到长度当中。
// $cls->start([$pre])
$cls->start();

The Versions

16/11 2016

dev-master

9999999-dev http://medz.cn

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

15/11 2016

v0.0.1

0.0.1.0 http://medz.cn

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires