Question: I am confused about what is business logic. I assume that it is written in Controller but then I search it on internet but i found that many person say that it refers to model. I am highly confused. And somee community meembers give me suggestions that my question is same but you are doing mistake. I am confused by the answers in those questions. Someone says model is business logic but I assume that Controller is business logic. So Please understand my doubt.

Answer: 
You can use `array_filter` with `callback` to return only type which is checkbox.

```
$filtered = array_filter($array, function($v){return $v['type'] == 'checkbox' && $v['is_active'] == 1;});

```

Working example :- <https://3v4l.org/idAR4>
You also can sue `array_reduce`, [Demo](https://3v4l.org/CnX47)

```
$filtered = array_reduce($array, function($a,$b){
    if($b['type'] == 'checkbox' && $b['is_active'] == 1){
        $a[] = $b;
        return $a;
    }else{
        return $a;
    }},[]);
print_r($filtered);

```