public function seek($position)
    {
        if ($position < 0) {
            throw new Exception(sprintf('%s() can\'t seek stream to negative line %d', __METHOD__, $position));
        }

        $this->rewind();
        while ($this->key() !== $position && $this->valid()) {
            $this->current();
            $this->next();
        }
        
        if (0 !== $position) {
            $this->offset--;
        }
        
        $this->current();
    }
public function seek($position)
    {
        if ($position < 0) {
            throw new Exception(sprintf('%s() can\'t seek stream to negative line %d', __METHOD__, $position));
        }

        $this->rewind();
        while ($this->key() !== $position && $this->valid()) {
            $this->current();
            $this->next();
        }
        
        if (0 !== $position) {
            $this->offset--;
        }
        
        $this->current();
    }
public function seek ( $ position ) { if ( $ position < 0 ) { throw new Exception ( sprintf ( '%s() can\'t seek stream to negative line %d' , __METHOD__ , $ position ) ) ; } $ this -> rewind ( ) ; while ( $ this -> key ( ) !== $ position && $ this -> valid ( ) ) { $ this -> current ( ) ; $ this -> next ( ) ; } if ( 0 !== $ position ) { $ this -> offset -- ; } $ this -> current ( ) ; }
Seek to specified line.

@see http://php.net/manual/en/splfileobject.seek.php

@param  int       $position
@throws Exception if the position is negative
Seek to specified line .