php - remove array on duplicate value -
i need help. want remove array on array list when there duplicate value. have array
array ( [11] => array ( [0] => array ( [count] => 2 [price] => 1000 [total] => 2000 ) [1] => array ( [count] => 0 [price] => 124 [total] => 0 ) [2] => array ( [count] => 0 [price] => 1000 [total] => 0 ) [3] => array ( [count] => 0 [price] => 2345 [total] => 0 ) ) [12] => array ( [0] => array ( [count] => 0 [price] => 1000 [total] => 0 ) [1] => array ( [count] => 1 [price] => 124 [total] => 124 ) [2] => array ( [count] => 0 [price] => 1000 [total] => 0 ) [3] => array ( [count] => 0 [price] => 2345 [total] => 0 ) ) ) as may notice there duplication value on price key. want remove array if the count equal 0. if duplicate price has no value on count. remove 1 duplicate array. expected output this.
array ( [11] => array ( [0] => array ( [count] => 2 [price] => 1000 [total] => 2000 ) [1] => array ( [count] => 0 [price] => 124 [total] => 0 ) [2] => array ( [count] => 0 [price] => 2345 [total] => 0 ) ) [12] => array ( [0] => array ( [count] => 0 [price] => 1000 [total] => 0 ) [1] => array ( [count] => 1 [price] => 124 [total] => 124 ) [2] => array ( [count] => 0 [price] => 2345 [total] => 0 ) ) ) please thanks.
Comments
Post a Comment