StrRules.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace crmeb\form\validate;
  12. use crmeb\form\FormValidate;
  13. /**
  14. * Class StrRules
  15. * @package crmeb\form\validate
  16. */
  17. class StrRules extends BaseRules
  18. {
  19. /**
  20. * 手机号正则
  21. */
  22. const PHONE_NUMBER = '/(^(\d{3,4}-)?[0-9]{7,8}$)|(^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])[0-9]{8}$)/';
  23. /**
  24. * 设置类型
  25. * @return string
  26. */
  27. public static function getType(): string
  28. {
  29. return 'string';
  30. }
  31. }