Horde_Xml_Wbxml_Decoder::termstr PHP Method

termstr() public method

Reads a null terminated string.
public termstr ( $input )
    public function termstr($input)
    {
        $str = '#';
        // must start with nonempty string to allow array access
        $i = 0;
        $ch = $input[$this->_strpos++];
        if (ord($ch) == 0) {
            return '';
            // don't return '#'
        }
        while (ord($ch) != 0) {
            $str[$i++] = $ch;
            $ch = $input[$this->_strpos++];
        }
        return $str;
    }