@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | if(empty($time)){ |
76 | 76 | list($msec, $sec) = explode(' ', microtime()); |
77 | 77 | $millisecond = (int)sprintf('%.0f', (floatval($msec) + floatval($sec)) * 1000); |
78 | - }elseif(is_numeric($time) && strlen((string)$time)==10){ |
|
78 | + } elseif(is_numeric($time) && strlen((string)$time)==10){ |
|
79 | 79 | $millisecond = (string)$time."000"; |
80 | - }else{ |
|
80 | + } else{ |
|
81 | 81 | $millisecond = strtotime($time)."000"; |
82 | 82 | } |
83 | 83 | return (int)$millisecond; |
@@ -162,12 +162,12 @@ discard block |
||
162 | 162 | foreach ($string as $key => $val) { |
163 | 163 | $_key = self::autoCharset($key, $from, $to); |
164 | 164 | $string[$_key] = self::autoCharset($val, $from, $to); |
165 | - if ($key != $_key) |
|
166 | - unset($string[$key]); |
|
165 | + if ($key != $_key) { |
|
166 | + unset($string[$key]); |
|
167 | + } |
|
167 | 168 | } |
168 | 169 | return $string; |
169 | - } |
|
170 | - else { |
|
170 | + } else { |
|
171 | 171 | return $string; |
172 | 172 | } |
173 | 173 | } |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | public static function getTime($date,$is_timestamp=false):string { |
206 | 206 | if($is_timestamp === true){ |
207 | 207 | $time = $date; |
208 | - }else{ |
|
208 | + } else{ |
|
209 | 209 | $time = strtotime($date);//时间转换为时间戳 |
210 | 210 | } |
211 | 211 |