亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何在方法 GET php CodeIgniter 中獲取多個值的一個變量

如何在方法 GET php CodeIgniter 中獲取多個值的一個變量

PHP
婷婷同學_ 2023-04-02 10:59:35
URL 創建 http://localhost/ci_search/product_filter/1?brand=Honor&brand=Infinix&brand=VIVO我要的網址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>查詢器$(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;    }});
查看完整描述

1 回答

?
牧羊人nacy

TA貢獻1862條經驗 獲得超7個贊

起初我曾經使用post 請求implode拆分數組


$brand=$this->input->post('brand');

$brands=implode(",",$brand);

然后我重定向到一個 url 獲取請求


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


查看完整回答
反對 回復 2023-04-02
  • 1 回答
  • 0 關注
  • 119 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號