承接 shortdark/lightswitch 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

shortdark/lightswitch

Composer 安装命令:

composer require shortdark/lightswitch

包简介

Lightswitch composer package generates customized arrays of random numbers.

README 文档

README

Lightswitch creates an array of unique integers when you specify the lowest integer, the highest integer and the volume of integers you require.

Installation

Install the latest version with

$ composer require shortdark/lightswitch

Basic Usage

<?php

require_once 'vendor/autoload.php';

$test = new Shortdark\Lightswitch();

// All you can do at the moment is to press the lightswitch
// press($lowest_integer, $highest_integer, $how_many_integers)
$result = $test->press(1,49,7);

// You can also specify two different rules, for example,
// 5 integers between 1 and 49, then 2 integers between 1 and 9
$result = $test->press(1,49,5,1,9,2);

// The result will be an array of integers
var_dump($result);

Basic Usage in a Laravel Controller

<?php

use App\Http\Controllers\Controller;
use Shortdark\Lightswitch;

class MyController extends Controller
{
    public function index(Lightswitch $light)
    {
        $result = $light->press(1,49,5,1,9,2);
        return view('index', compact('result'));
    }
    
}

Then, as $result is an array, to get a representation of the array you could have something like the following in the index.blade.php.

{{ json_encode($result) }}

Author

Neil Ludlow - neil@shortdark.net - https://twitter.com/shortdark

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-11-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固