public function stream_seek($offset, $whence)
    {
        switch ( $whence ) {
            case SEEK_SET:
                if ( ( $offset < $this->length ) &&
                     ( $offset >= 0 ) )
                {
                     $this->position = $offset;
                     return true;
                }
                else
                {
                     return false;
                }
                break;

            case SEEK_CUR:
                if ( $offset >= 0 )
                {
                     $this->position += $offset;
                     return true;
                }
                else
                {
                     return false;
                }
                break;

            case SEEK_END:
                if ( ( $this->length + $offset ) >= 0 )
                {
                     $this->position = $this->length + $offset;
                     return true;
                }
                else
                {
                     return false;
                }
                break;

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

            case SEEK_CUR:
                if ( $offset >= 0 )
                {
                     $this->position += $offset;
                     return true;
                }
                else
                {
                     return false;
                }
                break;

            case SEEK_END:
                if ( ( $this->length + $offset ) >= 0 )
                {
                     $this->position = $this->length + $offset;
                     return true;
                }
                else
                {
                     return false;
                }
                break;

            default:
                return false;
        }
    }
public function stream_seek ( $ offset , $ whence ) { switch ( $ whence ) { case SEEK_SET : if ( ( $ offset < $ this -> length ) && ( $ offset >= 0 ) ) { $ this -> position = $ offset ; return true ; } else { return false ; } break ; case SEEK_CUR : if ( $ offset >= 0 ) { $ this -> position += $ offset ; return true ; } else { return false ; } break ; case SEEK_END : if ( ( $ this -> length + $ offset ) >= 0 ) { $ this -> position = $ this -> length + $ offset ; return true ; } else { return false ; } break ; default : return false ; } }
Seek to a defined position in the string

@param int $offset
@param int $whence
@return bool
Seek to a defined position in the string