= $enTime) { $clTime = $enTime; } $temp = [ 'st' => $stTime, 'en' => $clTime ]; $timeRangeArr[] = $temp; $stTime = date('Y-m-d', $stTimeStr + (86400 * ($step + 1))); } return $timeRangeArr; } } if (!function_exists('getDayArr')) { /** * 获取时间数组 * @param $stTime * @param $enTime * @param int $step * @return array */ function getDayArr($stTime, $enTime, $formatData) { $dayArr = []; while ($stTime <= $enTime) { $temp = $formatData; $temp['day'] = $stTime; $dayArr[] = $temp; $stTime = date('Y-m-d', strtotime($stTime) + 86400); unset($temp); } return $dayArr; } } function h5_set_sign($params) { if(empty($params)){ return false; } $str = ''; ksort($params); foreach($params as $k=>$v){ if(is_array($v)){ $v = json_encode($v); } $str .= $k.'='.$v; } $solt = 'ur904wtr5pfctaw5'; $sign = md5(md5($str) . $solt); return $sign; } function h5_verify_sign($params) { if( empty($params) || !isset($params['sign']) ){ return false; } $sign = $params['sign']; unset($params['sign']); $_sign = h5_set_sign($params); if($sign == $_sign){ return true; } return false; }