将数组合并为一个更简单的数组(PHP)[关闭]

I have an array that looks like this. I'm looking at condensing this down into a simpler array (see below) how would I go about this?

array(1552) {
  [0]=>
  array(2) {
    [0]=>
    string(4) "3792"
    [1]=>
    string(2) "99"
  }
  [1]=>
  array(2) {
    [0]=>
    string(4) "3792"
    [1]=>
    string(3) "100"
  }
  [2]=>
  array(2) {
    [0]=>
    string(4) "3792"
    [1]=>
    string(3) "101"
  }
  [3]=>
  array(2) {
    [0]=>
    string(4) "3792"
    [1]=>
    string(3) "102"
  }
  [4]=>
  array(2) {
    [0]=>
    string(4) "3792"
    [1]=>
    string(3) "103"
  }
  [5]=>
  array(2) {
    [0]=>
    string(4) "3792"
    [1]=>
    string(3) "104"
  }
  [6]=>
  array(2) {
    [0]=>
    string(4) "3832"
    [1]=>
    NULL
  }
}

I would like to condense it down

array(1552) {
  [3792]=>
  array(2) {
    [0]=>
    string(4) "99"
    [1]=>
    string(2) "100"
    [2]=>
    string(2) "101"
    [3]=>
    string(2) "102"
    [3]=>
    string(2) "103"
    [3]=>
    string(2) "104"
  }
  [3832]=>
  array(2) {
    [0]=>
    NULL
  }

我有一个如下所示的数组。 我正在考虑将其缩小为一个更简单的数组(见下文)我将如何解决这个问题? p>

  array(1552){
 [0] =>  
 array(2){
 [0] => 
 string(4)“3792”
 [1] => 
 string(2)“99”
} 
 [1] =  > 
 array(2){
 [0] => 
 string(4)“3792”
 [1] => 
 string(3)“100”
} 
 [2  ] => 
 array(2){
 [0] => 
 string(4)“3792”
 [1] => 
 string(3)“101”
} 
  [3] => 
 array(2){
 [0] => 
 string(4)“3792”
 [1] => 
 string(3)“102”
}  
 [4] => 
 array(2){
 [0] => 
 string(4)“3792”
 [1] => 
 string(3)“103”\  n} 
 [5] => 
 array(2){
 [0] => 
 string(4)“3792”
 [1] => 
 string(3)“104  “
} 
 [6] => 
 array(2){
 [0] => 
 string(4)”3832“
 [1] => 
 NULL 
}  
} 
  code>  pre> 
 
 

我想将其浓缩下来 p>

  array(1552){
 [3792]  ] => 
 array(2){
 [0] => 
 string(4)“99”
 [1] => 
  string(2)“100”
 [2] => 
 string(2)“101”
 [3] => 
 string(2)“102”
 [3] => \  n string(2)“103”
 [3] => 
 string(2)“104”
} 
 [3832] => 
 array(2){
 [0] =>  ; 
 NULL 
} 
  code>  pre> 
  div>


 2 条回答

php