seffeng / php-rules by seffeng

PHP Rules
2,339
0
2
Package Data
Maintainer Username: seffeng
Maintainer Contact: save.zxf@gmail.com (seffeng)
Package Create Date: 2021-07-07
Package Last Update: 2024-08-30
Home Page: https://packagist.org/packages/seffeng/rules
Language: PHP
License: MIT
Last Refreshed: 2024-12-17 03:09:44
Package Statistics
Total Downloads: 2,339
Monthly Downloads: 21
Daily Downloads: 0
Total Stars: 0
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

Rules

安装

# 安装
$ composer require seffeng/rules

目录说明

├─src
│    IDNumber.php            身份证号
│    Password.php            密码
│    Phone.php               手机号

示例

  use Seffeng\Rules\IDNumber;
  
  /**
   * Test.php
   * 方法验证示例
   */
  public function test()
  {
      $rule = new IDNumber();
      $value = '123456789123456789';
      var_dump($rule->passes($value));exit;
  }

备注