Split data into Active and Not Active if flag it true if isset options

1
2
3
4
5
6
7
8
//Split data into Active and Not Active if flag it true
if(isset($options['activeInactive']) && $options['activeInactive']){
foreach ($result as $mnid => $mninfo){
$isActive = ($mninfo['is_active']) ? 'Active' : 'Not Active';
$res[$isActive][$mnid] = $mninfo['name'];
}
return isset($res) ? : array();
}