URL 創(chuàng)建 http://localhost/ci_search/product_filter/1?brand=Honor&brand=Infinix&brand=VIVO我要的網(wǎng)址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; }});
如何在方法 GET php CodeIgniter 中獲取多個(gè)值的一個(gè)變量
婷婷同學(xué)_
2023-04-02 10:59:35