GithubHelp home page GithubHelp logo

create-order-length-php's Introduction

create-order-length-php

Build Status StyleCI

概述

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

获取?

  • Composer: composer require medz/create-order-length-php

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

如何使用:

<?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();

create-order-length-php's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.