File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ if (!function_exists ('array_column ' )) {
4
+ /**
5
+ * PHP 版本兼容函数
6
+ * @param $input
7
+ * @param $columnKey
8
+ * @param $indexKey
9
+ * @return array
10
+ */
11
+ function array_column ($ input , $ columnKey , $ indexKey = null )
12
+ {
13
+ $ result = array ();
14
+ foreach ($ input as $ row ) {
15
+ if (isset ($ row [$ columnKey ])) {
16
+ if ($ indexKey !== null && isset ($ row [$ indexKey ])) {
17
+ $ result [$ row [$ indexKey ]] = $ row [$ columnKey ];
18
+ } else {
19
+ $ result [] = $ row [$ columnKey ];
20
+ }
21
+ }
22
+ }
23
+ return $ result ;
24
+ }
25
+ }
Original file line number Diff line number Diff line change 14
14
// | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper
15
15
// +----------------------------------------------------------------------
16
16
17
+ include_once __DIR__ . '/helper.php ' ;
18
+
17
19
spl_autoload_register (function ($ classname ) {
18
20
$ pathname = __DIR__ . DIRECTORY_SEPARATOR ;
19
21
$ filename = str_replace ('\\' , DIRECTORY_SEPARATOR , $ classname ) . '.php ' ;
You can’t perform that action at this time.
0 commit comments