//笛卡爾積 private function _dicaer($data) { $rr = array_shift($data); $result = []; while($arr2 = array_shift($data)){ $arr1 = $rr; $result = array(); foreach($arr1 as $v){ foreach($arr2 as $v2){ if(!is_array($v))$v = array($v); if(!is_array($v2))$v2 = array($v2); $result[] = array_merge_recursive($v,$v2); } } } return $result; }