public function readString($delim = "\x00")
    {

        // Get position of delimiter
        $len = strpos($this->data, $delim, min($this->index, $this->length));

        // If it is not found then return whole buffer
        if ($len === false) {
            return $this->read(strlen($this->data) - $this->index);
        }

        // Read the string and remove the delimiter
        $string = $this->read($len - $this->index);
        ++$this->index;

        return $string;
    }
public function readString($delim = "\x00")
    {

        // Get position of delimiter
        $len = strpos($this->data, $delim, min($this->index, $this->length));

        // If it is not found then return whole buffer
        if ($len === false) {
            return $this->read(strlen($this->data) - $this->index);
        }

        // Read the string and remove the delimiter
        $string = $this->read($len - $this->index);
        ++$this->index;

        return $string;
    }
public function readString ( $ delim = "\x00" ) { // Get position of delimiter $ len = strpos ( $ this -> data , $ delim , min ( $ this -> index , $ this -> length ) ) ; // If it is not found then return whole buffer if ( $ len === false ) { return $ this -> read ( strlen ( $ this -> data ) - $ this -> index ) ; } // Read the string and remove the delimiter $ string = $ this -> read ( $ len - $ this -> index ) ; ++ $ this -> index ; return $ string ; }
Read from buffer until delimiter is reached

If not found, return everything

@param string $delim

@return string
@throws \GameQ\Exception\Protocol
Read from buffer until delimiter is reached