手机号和身份证正则表达式
if(!empty($post['phone'])){
if (!preg_match("/^1[3456789]\d{9}$/", $post['phone'])) {
return __error('手机号码格式不正确');
}
}
if(!empty($post['identity'])) {
if (!preg_match("/^(\d{15}$|^\d{18}$|^\d{17}(\d|X|x))$/", $post['identity'])) {
return __error('身份证格式不正确');
}
}
//生成订单号 24位
function generate($prefix = 'C')
{
return $prefix . date('YmdHis', time()) . substr(microtime(), 2, 6) . sprintf('%03d', rand(0, 999));
}
/**
* //获取指定日期内每一天的日期
* @param Date $startdate 开始日期
* @param Date $end