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,ChenThis file is part of QBPWCF.QBPWCF is free software: you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe 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 ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with QBPWCF. If not, see <http://www.gnu.org/licenses/>.*/#使用命名空間qbpwcfnamespace qbpwcf;#assets dir$assetsDir="assets of arrays::mergeArray_20250430";#陣列A/*[0]=>array(4) {["ip"]=>string(1) "*"["port"]=>string(2) "80"["DocumentRoot"]=>string(15) "/var/www/qbpwcf"["ServerName"]=>string(27) "silverblue-guest.qbpwcf.org"}*/$arrayA=array(array("ip"=>"*","port"=>"80","DocumentRoot"=>"/var/www/qbpwcf","ServerName"=>"silverblue-guest.qbpwcf.org"));#陣列B/*[1]=>array(4) {["ip"]=>string(1) "*"["port"]=>string(3) "443"["DocumentRoot"]=>string(15) "/var/www/qbpwcf"["ServerName"]=>string(18) "ws-sock.qbpwcf.org"}*/$arrayB=array(array("ip"=>"*","port"=>"443","DocumentRoot"=>"/var/www/qbpwcf","ServerName"=>"ws-sock.qbpwcf.org"));#函式說明:#將多個一維陣列串聯起來,key從0開始排序.#回傳的結果:#$result["status"],"true"表執行正常,"false"代表執行不正常.#$result["error"],錯誤訊息陣列.#$result["function"],當前執行的函數.#$result["content"],合併好的一維陣列.#必填參數#$conf["inputArray"],陣列,要合併的一維陣列變數,例如:=array($array1,$array2);$conf["inputArray"]=array($arrayA,$arrayB);#可省略參數:#$conf["allowRepeat"],字串,預設為"true",允許重複的結果;若為"false"則不會出現重複的元素內容.$conf["allowRepeat"]="false";#$conf["looseDiff"],字串,預設為"false",代表要嚴謹判斷為有相異,例如陣列中元素的key順序不同(整數)就代表有相異;反之為"true",例如陣列中元素的key順序不同(整數),但value有相對應且相同.#$conf["looseDiff"]="false";#參考資料:#無.#備註:#無.$mergeArray=arrays::mergeArray($conf);unset($conf);#debugvar_dump($mergeArray);