Сообщество IT-специалистов
Ответы на любые вопросы об IT
Профессиональное развитие в IT
Удаленная работа для IT-специалистов
function OutputArray ($saArray) { $asKeY = array(); $asKeYoutput = array(); // $result_array = []; foreach ($saArray as $sKeyArray => $sValueArray) { .... $asKeYoutput[] = $asKeY; // $result_array [] = $array1; .... return $asKeYoutput; }
И не "склеивает":
Массив ($asKeYoutput): array(7) { [0]=> string(5) "AAA_0" [1]=> string(5) "BBB_0" [2]=> string(5) "CCC_0" [3]=> string(5) "DDD_0" [4]=> string(5) "EEE_0" [5]=> string(5) "FFF_0" [6]=> string(5) "GGG_0" }
Массив ($asKeYoutput): array(1) { [0]=> array(7) { [0]=> string(5) "AAA_0" [1]=> string(5) "BBB_0" [2]=> string(5) "CCC_0" [3]=> string(5) "DDD_0" [4]=> string(5) "EEE_0" [5]=> string(5) "FFF_0" [6]=> string(5) "GGG_0" } } Массив ($asKeYoutput): array(7) { [0]=> string(5) "AAA_1" [1]=> string(5) "BBB_1" [2]=> string(5) "CCC_1" [3]=> string(5) "DDD_1" [4]=> string(5) "EEE_1" [5]=> string(5) "FFF_1" [6]=> string(5) "GGG_1" }
Массив ($asKeYoutput): array(1) { [0]=> array(7) { [0]=> string(5) "AAA_1" [1]=> string(5) "BBB_1" [2]=> string(5) "CCC_1" [3]=> string(5) "DDD_1" [4]=> string(5) "EEE_1" [5]=> string(5) "FFF_1" [6]=> string(5) "GGG_1" } } Массив ($asKeYoutput): array(7) { [0]=> string(5) "AAA_2" [1]=> string(5) "BBB_2" [2]=> string(5) "CCC_2" [3]=> string(5) "DDD_2" [4]=> string(5) "EEE_2" [5]=> string(5) "FFF_2" [6]=> string(5) "GGG_2" }
Массив ($asKeYoutput): array(1) { [0]=> array(7) { [0]=> string(5) "AAA_2" [1]=> string(5) "BBB_2" [2]=> string(5) "CCC_2" [3]=> string(5) "DDD_2" [4]=> string(5) "EEE_2" [5]=> string(5) "FFF_2" [6]=> string(5) "GGG_2" } }