编程语言
首页 > 编程语言> > thinkphp5.1 使用小记

thinkphp5.1 使用小记

作者:互联网

namespace app\index\validate;

use think\Validate;

class User extends Validate
{
    protected $regex = [ 'zip' => '\d{6}'];
		
    protected $rule = [
        'name' => 'require|max:25',
	'email' => 'email',
    ];
}
//然后就可以使用
'zip'  => 'regex:zip'    

  By Liyy

标签:regex,zip,验证,模型,获取,使用,thinkphp5.1,小记
来源: https://www.cnblogs.com/widgetbox/p/12127952.html