public function setSelectedByValue($value)
    {
        $x = 0;
        foreach ($this->options as $idx => $data) {
            if ($value == $data) {
                $this->setSelectedIndex($x);

                return;
            }
            $x++;
        }

        $this->setSelectedIndex(-1);
    }
public function setSelectedByValue($value)
    {
        $x = 0;
        foreach ($this->options as $idx => $data) {
            if ($value == $data) {
                $this->setSelectedIndex($x);

                return;
            }
            $x++;
        }

        $this->setSelectedIndex(-1);
    }
public function setSelectedByValue ( $ value ) { $ x = 0 ; foreach ( $ this -> options as $ idx => $ data ) { if ( $ value == $ data ) { $ this -> setSelectedIndex ( $ x ) ; return ; } $ x ++ ; } $ this -> setSelectedIndex ( - 1 ) ; }
Sets selected index by entry return value
@param $value
Sets selected index by entry return value