You do not need to create a separate array for this. You can pass $_POST['std_id]that has an ids array .
controller
$this->modelname->mymethod($_POST['std_id'],$updateData);
where $_POST['std_id']is an array of identifiers and $updateDatafor updating fields
model
function mymethod($idArr,$data){
$this->db->where_in("fieldname", $idArr);
$this->db->update("tablename",$data);
}
you can use where_infor mysql INto check multiple ids.
source
share