public function setPosition($position, $whence)
    {
        switch ($whence) {
            case SEEK_SET:
                $this->position    = $position;
                break;
            case SEEK_CUR:
                $this->position    += $position;
                break;
            case SEEK_END:
                $this->position    = $this->length + $position;
                break;
            default:
                $this->position    = 0;
                return false;
        }

        if ($this->position < 0) {
            $this->position    = 0;
            return false;
        } else if ($this->position > $this->length) {
            $this->position    = $this->length;
            return false;
        } else {
            return true;
        }
    }
public function setPosition($position, $whence)
    {
        switch ($whence) {
            case SEEK_SET:
                $this->position    = $position;
                break;
            case SEEK_CUR:
                $this->position    += $position;
                break;
            case SEEK_END:
                $this->position    = $this->length + $position;
                break;
            default:
                $this->position    = 0;
                return false;
        }

        if ($this->position < 0) {
            $this->position    = 0;
            return false;
        } else if ($this->position > $this->length) {
            $this->position    = $this->length;
            return false;
        } else {
            return true;
        }
    }
public function setPosition ( $ position , $ whence ) { switch ( $ whence ) { case SEEK_SET : $ this -> position = $ position ; break ; case SEEK_CUR : $ this -> position += $ position ; break ; case SEEK_END : $ this -> position = $ this -> length + $ position ; break ; default : $ this -> position = 0 ; return false ; } if ( $ this -> position < 0 ) { $ this -> position = 0 ; return false ; } else if ( $ this -> position > $ this -> length ) { $ this -> position = $ this -> length ; return false ; } else { return true ; } }
Sets the pointer position

@param   integer     $position   The position in bytes
@param   integer     $whence     The reference from where to measure $position (SEEK_SET, SEEK_CUR or SEEK_END)
@return  boolean                 True if the position could be set
Sets the pointer position