Subversion Repositories php-qbpwcf

Rev

Rev 4 | Rev 226 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php

/*

        QBPWCF, Quick Build PHP website Component base on Fedora Linux.
    Copyright (C) 2014~2025 Min-Jhin,Chen

    This file is part of QBPWCF.

    QBPWCF is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    QBPWCF is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with QBPWCF.  If not, see <http://www.gnu.org/licenses/>.

*/

#使用命名空間qbpwcf
namespace qbpwcf;

#assets dir
$assetsDir="assets of arrays::mergeArray_20250419";

#陣列Caa
$arrayCaa=array("A"=>"a","B"=>"b","C"=>"c");

#陣列Ca
$arrayCa=array("A"=>"a","B"=>"b","C"=>$arrayCaa);

#陣列A
$arrayA=array("A"=>"a","B"=>"b","Ca"=>$arrayCa);

#陣列Eaa
$arrayEaa=array("D"=>"d","E"=>"e","F"=>"f");

#陣列Ea
$arrayEa=array("D"=>"d","E"=>$arrayEaa,"F"=>"f");

#陣列B
$arrayB=array("D"=>"d","Ea"=>$arrayEa,"F"=>"f");

#重複的陣列A
$repeatedA=$arrayA;

#重複的陣列B
$repeatedB=$arrayB;

#函式說明:
#將多個一維陣列串聯起來,key從0開始排序.
#回傳的結果:
#$result["status"],"true"表執行正常,"false"代表執行不正常.
#$result["error"],錯誤訊息陣列.
#$result["function"],當前執行的函數.
#$result["content"],合併好的一維陣列.
#必填參數
#$conf["inputArray"],陣列,要合併的一維陣列變數,例如:=array($array1,$array2);
$conf["inputArray"]=array($arrayA,$arrayB,$repeatedA,$repeatedB);
#可省略參數:
#$conf["allowRepeat"],字串,預設為"true",允許重複的結果;若為"false"則不會出現重複的元素內容.
$conf["allowRepeat"]="false";
#$conf["looseDiff"],字串,預設為"false",代表要嚴謹判斷為有相異,例如陣列中元素的key順序不同(整數)就代表有相異;反之為"true",例如陣列中元素的key順序不同(整數),但value有相對應且相同.
#$conf["looseDiff"]="false";
#參考資料:
#無.
#備註:
#無.
$mergeArray=arrays::mergeArray($conf);
unset($conf);

#debug
var_dump($mergeArray);