function.php 1010 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | LARAVEL8.0 框架 [ LARAVEL ][ RXThinkCMF ]
  4. // +----------------------------------------------------------------------
  5. // | 版权所有 2017~2021 LARAVEL研发中心
  6. // +----------------------------------------------------------------------
  7. // | 官方网站: http://www.laravel.cn
  8. // +----------------------------------------------------------------------
  9. // | Author: laravel开发员 <laravel.qq.com>
  10. // +----------------------------------------------------------------------
  11. if (!function_exists('getValidatorError')) {
  12. /**
  13. * 错误验证
  14. * @param $error
  15. * @return mixed
  16. */
  17. function getValidatorError($validator)
  18. {
  19. $errors = $validator->errors()->all();
  20. return isset($errors[0]) ? $errors[0] : 1013;
  21. }
  22. }
  23. /**
  24. * 是否是手机号码
  25. */
  26. if (!function_exists('isPhone')) {
  27. function isPhone($mobile)
  28. {
  29. return preg_match("/^1[3-9][0-9]]{9}/");
  30. }
  31. }