Subversion Repositories php-qbpwcf

Rev

Rev 226 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 liveuser 1
<?php
2
 
3
/*
4
 
5
        QBPWCF, Quick Build PHP website Component base on Fedora Linux.
239 liveuser 6
    Copyright (C) 2014~2026 MIN ZHI, CHEN
4 liveuser 7
 
8
    This file is part of QBPWCF.
9
 
10
    QBPWCF is free software: you can redistribute it and/or modify
11
    it under the terms of the GNU General Public License as published by
12
    the Free Software Foundation, either version 3 of the License, or
13
    (at your option) any later version.
14
 
15
    QBPWCF is distributed in the hope that it will be useful,
16
    but WITHOUT ANY WARRANTY; without even the implied warranty of
17
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
    GNU General Public License for more details.
19
 
20
    You should have received a copy of the GNU General Public License
21
    along with QBPWCF.  If not, see <http://www.gnu.org/licenses/>.
22
 
23
*/
24
 
25
#使用命名空間qbpwcf
26
namespace qbpwcf;
27
 
28
#assets dir
29
$assetsDir="assets of arrays::mergeArray_20250430";
30
 
31
#陣列A
32
/*
33
[0]=>
34
      array(4) {
35
        ["ip"]=>
36
        string(1) "*"
37
        ["port"]=>
38
        string(2) "80"
39
        ["DocumentRoot"]=>
40
        string(15) "/var/www/qbpwcf"
41
        ["ServerName"]=>
42
        string(27) "silverblue-guest.qbpwcf.org"
43
}
44
*/
45
$arrayA=array(array("ip"=>"*","port"=>"80","DocumentRoot"=>"/var/www/qbpwcf","ServerName"=>"silverblue-guest.qbpwcf.org"));
46
 
47
#陣列B
48
/*
49
[1]=>
50
      array(4) {
51
        ["ip"]=>
52
        string(1) "*"
53
        ["port"]=>
54
        string(3) "443"
55
        ["DocumentRoot"]=>
56
        string(15) "/var/www/qbpwcf"
57
        ["ServerName"]=>
58
        string(18) "ws-sock.qbpwcf.org"
59
}
60
*/
61
$arrayB=array(array("ip"=>"*","port"=>"443","DocumentRoot"=>"/var/www/qbpwcf","ServerName"=>"ws-sock.qbpwcf.org"));
62
 
63
#函式說明:
64
#將多個一維陣列串聯起來,key從0開始排序.
65
#回傳的結果:
66
#$result["status"],"true"表執行正常,"false"代表執行不正常.
67
#$result["error"],錯誤訊息陣列.
68
#$result["function"],當前執行的函數.
69
#$result["content"],合併好的一維陣列.
70
#必填參數
71
#$conf["inputArray"],陣列,要合併的一維陣列變數,例如:=array($array1,$array2);
72
$conf["inputArray"]=array($arrayA,$arrayB);
73
#可省略參數:
74
#$conf["allowRepeat"],字串,預設為"true",允許重複的結果;若為"false"則不會出現重複的元素內容.
75
$conf["allowRepeat"]="false";
76
#$conf["looseDiff"],字串,預設為"false",代表要嚴謹判斷為有相異,例如陣列中元素的key順序不同(整數)就代表有相異;反之為"true",例如陣列中元素的key順序不同(整數),但value有相對應且相同.
77
#$conf["looseDiff"]="false";
78
#參考資料:
79
#無.
80
#備註:
81
#無.
82
$mergeArray=arrays::mergeArray($conf);
83
unset($conf);
84
 
85
#debug
226 liveuser 86
var_dump($mergeArray);