在foreach循环中使用array_combine将多个数组转换为单个数组

I am trying array_combine to convert all these arrays into a single array with the unique value.

$arr_ch_no = array();
        $arr_ch_no[] = "'***0***'";
        $sql = mysql_query("SELECT ship_name,voy_no from tb_veh_data_entry WHERE (ETAQ > '".date("Y-m-d")."' or (ETAQ <> '0000-00-00' and stock = 0 and stock_sale_date = '0000-00-00')) and (user_id = 'UI08-00000063' or user_id = 'UI09-00000111') and stock_country = 58 and ((buyer in ('6371','2509','2535') and arica = 0 ) or arica=4)  group by ship_name,voy_no  ");
        while($row_no = mysql_fetch_array($sql))
        {
            $str_no_ch = selFieldCon("tb_veh_data_entry","GROUP_CONCAT(frame_no)"," ship_name = '".$row_no['ship_name']."' and voy_no = '".$row_no['voy_no']."'   and (user_id = 'UI08-00000063' or user_id = 'UI09-00000111') and stock_country = 58   and ((buyer in ('6371','2509','2535') and arica = 0 ) or arica=4) and ETAQ <> '0000-00-00' ".$this->condition."");
            $arr_no_ch = array();
            $arr_no_ch = explode(",",$str_no_ch);
            if($str_no_ch != '')
            foreach($arr_no_ch as $val)
                $arr_ch_no[] = "'".$val."'";
        }

This query use for foreach loop

$sql    =    "SELECT * FROM tb_veh_data_entry WHERE 1 ".$this->condition." ";

I am trying this inside foreach.

foreach loop //start

array_unique(array_combine($arr_ch_no));

How can I convert it into a single array inside foreach.

Array
    (
        [0] => '***0***'
        [1] => 'NCP100-0027131'
    )
    Array
    (
        [0] => '***0***'
        [1] => 'NCP100-0027131'
    )
    Array
    (
        [0] => '***0***'
        [1] => 'NCP100-0027131'
    )

But I do not get anything.

this is not good solution. hope it can help you.

$data1 = array_column($array, 0, 1);
$data2 = array_column($array, 1, 0);

$data1Length = count($data1);
$data2Length = count($data2);

$result = [];
if($data1Length > $data2Length) {
    foreach($data1Length as $k => $v) {
        $result[] = [$v, $k];
    }
} else {
    foreach($data1Length as $k => $v) {
        $result[] = [$k, $v];
    }
}