= 1024 && $i < 6; $i++) { $size /= 1024; } return round($size, $precision) . $delimiter . $units[$i]; } } if (!function_exists('resp_json')) { /** * 返回json * @param int $code code * @param string $msg 返回信息 * @param int $data 返回数据 * @return string */ function resp_json($code, $msg = '', $data = null) { return json(['code' => $code,'msg' => $msg,'data' => $data]); } } function isEnglish($char) { $code = ord($char); return ($code >= 0x00 && $code <= 0x7F); // ASCII码范围 }