public function readStringMulti($delims, &$delimfound = null)
    {

        // Get position of delimiters
        $pos = [];
        foreach ($delims as $delim) {
            if ($p = strpos($this->data, $delim, min($this->index, $this->length))) {
                $pos[] = $p;
            }
        }

        // If none are found then return whole buffer
        if (empty($pos)) {
            return $this->read(strlen($this->data) - $this->index);
        }

        // Read the string and remove the delimiter
        sort($pos);
        $string = $this->read($pos[0] - $this->index);
        $delimfound = $this->read();

        return $string;
    }
public function readStringMulti($delims, &$delimfound = null)
    {

        // Get position of delimiters
        $pos = [];
        foreach ($delims as $delim) {
            if ($p = strpos($this->data, $delim, min($this->index, $this->length))) {
                $pos[] = $p;
            }
        }

        // If none are found then return whole buffer
        if (empty($pos)) {
            return $this->read(strlen($this->data) - $this->index);
        }

        // Read the string and remove the delimiter
        sort($pos);
        $string = $this->read($pos[0] - $this->index);
        $delimfound = $this->read();

        return $string;
    }
public function readStringMulti ( $ delims , & $ delimfound = null ) { // Get position of delimiters $ pos = [ ] ; foreach ( $ delims as $ delim ) { if ( $ p = strpos ( $ this -> data , $ delim , min ( $ this -> index , $ this -> length ) ) ) { $ pos [ ] = $ p ; } } // If none are found then return whole buffer if ( empty ( $ pos ) ) { return $ this -> read ( strlen ( $ this -> data ) - $ this -> index ) ; } // Read the string and remove the delimiter sort ( $ pos ) ; $ string = $ this -> read ( $ pos [ 0 ] - $ this -> index ) ; $ delimfound = $ this -> read ( ) ; return $ string ; }
Read from buffer until any of the delimiters is reached

If not found, return everything

@param      $delims
@param null $delimfound

@return string
@throws \GameQ\Exception\Protocol

@todo: Check to see if this is even used anymore
Read from buffer until any of the delimiters is reached