/*************** * @function 三維數組轉二維數組 * @Param: $array : 傳入參數 * @Return: $tempArr 返回結果數組 ***************/ function array3_to_array2($array){ $array = array_filter($array); $array = array_values($array); foreach ($array as $orderKey =>$orderVal){ $count = count($orderVal); if($count > 1){ for ($i = 0;$i < $count;$i++){ $tempArr[] = $orderVal[$i]; } }else{ $tempArr[] = $orderVal[0]; } } return $tempArr; }