> 12)); $ord_2 = decbin(0x80 | (($code >> 6) & 0x3f)); $ord_3 = decbin(0x80 | ($code & 0x3f)); $utf8Str = chr(bindec($ord_1)) . chr(bindec($ord_2)) . chr(bindec($ord_3)); return $utf8Str; } /** * 获取当前时间戳 - 精切到毫秒 * @return float */ public static function timestamp() { list($t1, $t2) = explode(' ', microtime()); return (float)sprintf('%.0f',(floatval($t1)+floatval($t2))*1000); } /** * 取一维数组总最小值的那个KEY * @param $array * @return int|string|null */ public static function getArrayKeyByMinValue($array) { $key = null; $minValue = null; foreach ($array ?? [] as $k=>$v) { if (is_null($key)) { $key = $k; $minValue = $v; } if ($v < $minValue) { $key = $k; $minValue = $v; } } return $key; } }