private static function getStringFromBuffer($buffer, &$offset)
    {
        if (($length = self::getIntegerFromBuffer($buffer, $offset, ':')) < 0) {
            throw new DecodingException("Invalid string length: $length", $offset);
        }

        if ($length == 0) {
            return '';
        }

        $string = substr($buffer, $offset, $length);
        $offset += $length;

        return $string;
    }
private static function getStringFromBuffer($buffer, &$offset)
    {
        if (($length = self::getIntegerFromBuffer($buffer, $offset, ':')) < 0) {
            throw new DecodingException("Invalid string length: $length", $offset);
        }

        if ($length == 0) {
            return '';
        }

        $string = substr($buffer, $offset, $length);
        $offset += $length;

        return $string;
    }
private static function getStringFromBuffer ( $ buffer , & $ offset ) { if ( ( $ length = self :: getIntegerFromBuffer ( $ buffer , $ offset , ':' ) ) < 0 ) { throw new DecodingException ( "Invalid string length: $length" , $ offset ) ; } if ( $ length == 0 ) { return '' ; } $ string = substr ( $ buffer , $ offset , $ length ) ; $ offset += $ length ; return $ string ; }
Decodes a string from the buffer.

@param string $buffer Buffer containing the Bencode string.
@param int $offset Current position in the buffer.
@return string
Decodes a string from the buffer .