定制 xihrni/php-tools 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

xihrni/php-tools

Composer 安装命令:

composer require xihrni/php-tools

包简介

This is the tool class for PHP.

README 文档

README

Introduction

PHP使用的各种工具类

Install

$ composer require xihrni/php-tools

Demo

Other

<?php

use xihrni\tools\Other;

// $data = ...;
Other::dump($data);

Yii2

<?php

use xihrni\tools\Yii2;

// ...

public function beforeAction($action)
{
    $moduleId = Yii2::getFullModuleId($action->controller->module, $ids = []);
}


// ...

backupDataTableForSql(User::tableName());

Arrays

<?php

use xihrni\tools\Arrays;

// ...

$list = [
    [
        'id' => 1,
        'parent_id' => null,
        'title' => '顶级分类1',
    ],
    [
        'id' => 2,
        'parent_id' => null,
        'title' => '顶级分类2',
    ],
    [
        'id' => 3,
        'parent_id' => 1,
        'title' => '子分类1',
    ],
    [
        'id' => 4,
        'parent_id' => 3,
        'title' => '子分类2',
    ],
];

$tree = Arrays::list2Tree($list);
var_dump($tree);

$remark  = '操作,1=>管理员创建卡券,2=>管理员更新卡券,3=>管理员删除卡券,12=>用户使用卡券券码';
$operate = Arrays::str2Enum($remark, '', '=>');
var_dump($operate);

Verify

<?php

use xihrni\tools\Verify;

// ...

if (Verify::idCardNumber('110101199003078910')) {
    // true
} else {
    // false
}

if (Verify::isMobile()) {
    // true
} else {
    // false
}

if (Verify::isWechat()) {
    // true
} else {
    // false
}

统计信息

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

GitHub 信息

  • Stars: 11
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-04-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固