如何在方法 GET php CodeIgniter 中为多个值获取一个变量

How to get one variable for Multiple Value in method GET php CodeIgniter

URL 已创建 http://localhost/ci_search/product_filter/1?brand=Honor&brand=Infinix&brand=VIVO

URL我要

http://localhost/ci_search/product_filter/1?brand=Honor,Infinix,VIVO

<form id="form" method="GET" action="<?= base_url('product_filter/filter_url') ?>">
<div class="container">
    <div class="row">
foreach($brand_data->result_array() as $key=>$row)
                {
                ?>
                <div class="list-group-item checkbox">
                    <label><input  type="checkbox" name="brand[]" class="common_selector brand" value="<?php echo $row['product_brand']; ?>" > <?php echo $row['product_brand']; ?></label>
                </div>
                <?php
                }
                ?>
</div>

JQUERY

$(document).ready(function(){

$(".brand").change(function() {
if(this.checked) {
    //Do stuff

    alert(get_filter('brand'));
    $("#form").submit();
}

});

function get_filter(class_name)
    {
        var filter = [];
        $('.'+class_name+':checked').each(function(){
            filter.push($(this).val());
        });
        return filter;
    }
});

起初我使用implode通过post请求

拆分数组
$brand=$this->input->post('brand');
$brands=implode(",",$brand);

然后我重定向到 url 获取请求

redirect(base_url('product/category/detail?').'brand='.$brands);