public function isSelected($selected, $value, $i)
    {
        if (is_array($selected)) {
            foreach ($selected as $s) {
                if ($this->isSelected($s, $value, $i)) {
                    return true;
                }
            }
        } elseif (is_int($selected) && $i === $selected) {
            return true;
        } elseif ($value === $selected) {
            return true;
        }

        return false;
    }
public function isSelected($selected, $value, $i)
    {
        if (is_array($selected)) {
            foreach ($selected as $s) {
                if ($this->isSelected($s, $value, $i)) {
                    return true;
                }
            }
        } elseif (is_int($selected) && $i === $selected) {
            return true;
        } elseif ($value === $selected) {
            return true;
        }

        return false;
    }
public function isSelected ( $ selected , $ value , $ i ) { if ( is_array ( $ selected ) ) { foreach ( $ selected as $ s ) { if ( $ this -> isSelected ( $ s , $ value , $ i ) ) { return true ; } } } elseif ( is_int ( $ selected ) && $ i === $ selected ) { return true ; } elseif ( $ value === $ selected ) { return true ; } return false ; }
Checks for selected options.

@param string  $selected targeted selected value
@param mixed   $value    the current value
@param integer $i        the current key

@return boolean
Checks for selected options .