6
6
*
7
7
* @param $string
8
8
* @return bool
9
- * @author jiangbingjie<[email protected] >
9
+ *
10
10
*/
11
11
function is_json ($ string )
12
12
{
@@ -22,7 +22,7 @@ function is_json($string)
22
22
*
23
23
* @param $str
24
24
* @return bool
25
- * @author jiangbingjie<[email protected] >
25
+ *
26
26
*/
27
27
function is_not_json ($ str )
28
28
{
@@ -39,7 +39,7 @@ function is_not_json($str)
39
39
* @param string $lev 可选参数,纠错等级
40
40
* @param string $margin 生成的二维码离边框的距离
41
41
* @return string
42
- * @author jiangbingjie<[email protected] >
42
+ *
43
43
*/
44
44
function create_erweima ($ content , $ size = '200 ' , $ lev = 'L ' , $ margin = '0 ' )
45
45
{
@@ -56,7 +56,7 @@ function create_erweima($content, $size = '200', $lev = 'L', $margin = '0')
56
56
*
57
57
* @create 2019-01-29 12:04:26
58
58
* @return bool
59
- * @author jiangbingjie<[email protected] >
59
+ *
60
60
*/
61
61
function is_https ()
62
62
{
@@ -71,14 +71,15 @@ function is_https()
71
71
return false ;
72
72
}
73
73
}
74
+
74
75
if (!function_exists ('get_curl_data ' )) {
75
76
/**
76
77
* 请求远程数据
77
78
*
78
79
* @param string $url
79
80
* @param array $param
80
81
* @return mixed
81
- * @author jiangbingjie<[email protected] >
82
+ *
82
83
*/
83
84
function get_curl_data ($ url , $ param = [])
84
85
{
@@ -112,7 +113,7 @@ function get_curl_data($url, $param = [])
112
113
* @date 2017-02-20 19:41:22
113
114
* @param string $img_file 传入本地图片地址
114
115
* @return string
115
- * @author jiangbingjie<[email protected] >
116
+ *
116
117
*/
117
118
function imgToBase64 ($ img_file )
118
119
{
@@ -163,7 +164,7 @@ function imgToBase64($img_file)
163
164
*移动端判断
164
165
*
165
166
* @return bool
166
- * @author jiangbingjie<[email protected] >
167
+ *
167
168
*/
168
169
function isMobile ()
169
170
{
@@ -236,7 +237,7 @@ function isMobile()
236
237
*
237
238
* @param int $time
238
239
* @return string
239
- * @author jiangbingjie<[email protected] >
240
+ *
240
241
*/
241
242
function git_second ($ time )
242
243
{
@@ -256,7 +257,7 @@ function git_second($time)
256
257
* @param string $day1
257
258
* @param string $day2
258
259
* @return string
259
- * @author jiangbingjie<[email protected] >
260
+ *
260
261
*/
261
262
function diffBetweenTwoDays ($ day1 , $ day2 )
262
263
{
@@ -278,7 +279,7 @@ function diffBetweenTwoDays($day1, $day2)
278
279
* 获取时间,采用标准时区。
279
280
*
280
281
* @return string
281
- * @author jiangbingjie<[email protected] >
282
+ *
282
283
*/
283
284
function get_time ()
284
285
{
@@ -294,7 +295,7 @@ function get_time()
294
295
*
295
296
* @param int $time
296
297
* @return string
297
- * @author jiangbingjie<[email protected] >
298
+ *
298
299
*/
299
300
function get_date ($ time )
300
301
{
@@ -311,7 +312,7 @@ function get_date($time)
311
312
* @param int $time
312
313
* @param int $time_str
313
314
* @return string
314
- * @author jiangbingjie<[email protected] >
315
+ *
315
316
*/
316
317
function get_date_str ($ time , $ time_str )
317
318
{
@@ -321,12 +322,25 @@ function get_date_str($time, $time_str)
321
322
}
322
323
}
323
324
325
+ if (!function_exists ('is_date ' )) {
326
+ /**
327
+ * 判断是否为日期格式
328
+ *
329
+ * @param string $time 时间字符串
330
+ * @return boolean
331
+ */
332
+ function is_date ($ time )
333
+ {
334
+ return strtotime ($ time );
335
+ }
336
+ }
337
+
324
338
if (!function_exists ('get_uuid ' )) {
325
339
/**
326
340
* 获取唯一id
327
341
*
328
342
* @return string
329
- * @author jiangbingjie<[email protected] >
343
+ *
330
344
*/
331
345
function get_uuid ()
332
346
{
@@ -338,7 +352,7 @@ function get_uuid()
338
352
/**
339
353
* 获取毫秒级别的时间戳
340
354
*
341
- * @author jiangbingjie<[email protected] >
355
+ *
342
356
*/
343
357
function getMillisecond ()
344
358
{
@@ -359,7 +373,7 @@ function getMillisecond()
359
373
* @create 2019-01-24 15:21:21
360
374
* @param $seconds
361
375
* @return float|int|string
362
- * @author jiangbingjie<[email protected] >
376
+ *
363
377
*/
364
378
function get_date_second ($ seconds )
365
379
{
@@ -380,7 +394,7 @@ function get_date_second($seconds)
380
394
*
381
395
* @param int $time
382
396
* @return string
383
- * @author jiangbingjie<[email protected] >
397
+ *
384
398
*/
385
399
function get_date_after ($ time )
386
400
{
@@ -396,7 +410,7 @@ function get_date_after($time)
396
410
*
397
411
* @param string $str
398
412
* @return string
399
- * @author jiangbingjie<[email protected] >
413
+ *
400
414
*/
401
415
function check_phone ($ str )
402
416
{
@@ -414,7 +428,7 @@ function check_phone($str)
414
428
*
415
429
* @param string $str
416
430
* @return string
417
- * @author jiangbingjie<[email protected] >
431
+ *
418
432
*/
419
433
function check_mail ($ str )
420
434
{
@@ -432,7 +446,7 @@ function check_mail($str)
432
446
*
433
447
* @param string $str
434
448
* @return string
435
- * @author jiangbingjie<[email protected] >
449
+ *
436
450
*/
437
451
function check_int ($ str )
438
452
{
@@ -450,7 +464,7 @@ function check_int($str)
450
464
*
451
465
* @param string $str
452
466
* @return string
453
- * @author jiangbingjie<[email protected] >
467
+ *
454
468
*/
455
469
function get_cn ($ str )
456
470
{
@@ -467,7 +481,7 @@ function get_cn($str)
467
481
*
468
482
* @param string $str
469
483
* @return string
470
- * @author jiangbingjie<[email protected] >
484
+ *
471
485
*/
472
486
function get_int ($ str )
473
487
{
@@ -483,7 +497,7 @@ function get_int($str)
483
497
* 获取ip
484
498
*
485
499
* @return string
486
- * @author jiangbingjie<[email protected] >
500
+ *
487
501
*/
488
502
function get_from_ip ()
489
503
{
@@ -512,9 +526,9 @@ function get_from_ip()
512
526
* @param $params
513
527
* @param $secret_key
514
528
* @return string
515
- * @author jiaozi<[email protected] >
516
529
*
517
- * @author jiangbingjie<[email protected] >
530
+ *
531
+ *
518
532
*/
519
533
function sign ($ params , $ secret_key )
520
534
{
@@ -536,7 +550,7 @@ function sign($params, $secret_key)
536
550
*
537
551
* @param int $time
538
552
* @return string
539
- * @author jiangbingjie<[email protected] >
553
+ *
540
554
*/
541
555
function transformTime ($ time )
542
556
{
@@ -600,7 +614,7 @@ function timeFormat($timestamp = 0, $format = 'Y-m-d H:i:s')
600
614
*
601
615
* @param string $str 用逗号分隔的多个参数
602
616
* @return mixed
603
- * @author jiangbingjie<[email protected] >
617
+ *
604
618
*/
605
619
function pack_input_params ($ str )
606
620
{
@@ -619,7 +633,7 @@ function pack_input_params($str)
619
633
*
620
634
* @param $strParam
621
635
* @return null|string|string[] | 过滤非法字符
622
- * @author jiangbingjie<[email protected] >
636
+ *
623
637
*/
624
638
function replace_special_char ($ strParam )
625
639
{
@@ -635,7 +649,7 @@ function replace_special_char($strParam)
635
649
*
636
650
* @param array $e
637
651
* @return mixed
638
- * @author jiangbingjie<[email protected] >
652
+ *
639
653
*/
640
654
function array_to_object ($ e )
641
655
{
@@ -658,7 +672,7 @@ function array_to_object($e)
658
672
*
659
673
* @param object $obj
660
674
* @return array
661
- * @author jiangbingjie<[email protected] >
675
+ *
662
676
*/
663
677
function object_to_array ($ obj )
664
678
{
@@ -681,7 +695,7 @@ function object_to_array($obj)
681
695
*
682
696
* @param array $data
683
697
* @return array
684
- * @author jiangbingjie<[email protected] >
698
+ *
685
699
*/
686
700
function array_filter_null (array $ data )
687
701
{
@@ -701,7 +715,7 @@ function array_filter_null(array $data)
701
715
*
702
716
* @param string $ary
703
717
* @return string
704
- * @author jiangbingjie<[email protected] >
718
+ *
705
719
*/
706
720
function get_good_str ($ ary )
707
721
{
@@ -733,7 +747,7 @@ function get_good_str($ary)
733
747
*
734
748
* @param string $str
735
749
* @return string
736
- * @author jiangbingjie<[email protected] >
750
+ *
737
751
*/
738
752
function strip_quotes ($ str )
739
753
{
@@ -750,7 +764,7 @@ function strip_quotes($str)
750
764
* @param $value
751
765
* @param $key
752
766
* @return array|获取符合mysql IN的 id数组
753
- * @author jiangbingjie<[email protected] >
767
+ *
754
768
*/
755
769
function get_ids ($ array , $ value , $ key = null )
756
770
{
@@ -766,7 +780,7 @@ function get_ids($array, $value, $key = null)
766
780
* @param array $data //原始数据
767
781
* @param $field //需要计算的字段
768
782
* @return array
769
- * @author jiangbingjie<[email protected] >
783
+ *
770
784
*/
771
785
function calculate_summation (array $ data , $ field )
772
786
{
@@ -873,7 +887,7 @@ function array_sort($arr, $keys, $type = 'desc')
873
887
* @param $data
874
888
* @param $limit
875
889
* @return array
876
- * @author jiangbingjie<[email protected] >
890
+ *
877
891
*/
878
892
function paging ($ data , $ limit )
879
893
{
@@ -900,7 +914,7 @@ function paging($data, $limit)
900
914
* my_rmdir
901
915
*
902
916
* @param string $path
903
- * @author jiangbingjie<[email protected] >
917
+ *
904
918
*/
905
919
function my_rmdir ($ path )
906
920
{
@@ -928,7 +942,7 @@ function my_rmdir($path)
928
942
* @create 2018-12-12 14:42:00
929
943
* @param string $format
930
944
* @return false|int
931
- * @author jiangbingjie<[email protected] >
945
+ *
932
946
*/
933
947
function week ($ format = '' )
934
948
{
@@ -947,7 +961,7 @@ function week($format = '')
947
961
* @param $begin
948
962
* @param $end
949
963
* @return array
950
- * @author jiangbingjie<[email protected] >
964
+ *
951
965
*/
952
966
function get_full_day_time ($ begin , $ end )
953
967
{
@@ -973,7 +987,7 @@ function get_full_day_time($begin, $end)
973
987
* @name 获取某段时间内完整自然周的时间戳
974
988
* @param
975
989
* @return array
976
- * @author zay
990
+ *
977
991
*/
978
992
function get_full_week_time ($ start_time , $ end_time )
979
993
{
@@ -1012,7 +1026,7 @@ function get_full_week_time($start_time, $end_time)
1012
1026
* @name 获取某段时间内完整自然月的时间戳
1013
1027
* @param
1014
1028
* @return array
1015
- * @author zay
1029
+ *
1016
1030
*/
1017
1031
function get_full_month_time ($ start_time , $ end_time )
1018
1032
{
0 commit comments