Returns a reversed string. A multibyte version of strrev().

@return Stringy Object with a reversed $str
515631
public function reverse() {
        $strLength = $this->length();
        $reversed = '';

        // Loop from last index of string to first
        for ($i = $strLength - 1; $i >= 0; $i--) {
            $reversed .= mb_substr($this->str, $i, 1, $this->encoding);
        }

        return self::create($reversed, $this->encoding);
    }
840268
public function toString()
    {
        if (!$this->isSeekable()) {
            return $this->flush();
        }
        $old = $this->tell();
        $this->rewind();
        $result = $this->flush();
        $this->seek($old);
        return $result;
    }
1279817
public static function getString(&$str)
    {
        $p = strpos($str, "\x00");
        if ($p === false) {
            return '';
        }
        $r   = static::binarySubstr($str, 0, $p);
        $str = static::binarySubstr($str, $p + 1);

        return $r;
    }
655809
public function toString(): string
    {
        $parts = array_map(
            function (RDN $rdn) {
                return $rdn->toString();
            }, array_reverse($this->_rdns));
        return implode(",", $parts);
    }
1181422
public function readStringLen()
    {
        $l = $this->readIntLen();
        if ($l === null) {
            return $l;
        }

        return $this->read($l);
    }
262143
public function readString()
    {
        try {
            $binLength = $this->getStream()->read(2);
            $length = current(unpack('S', $binLength));

            return $this->getStream()->read($length);
        } catch (StreamException $e) {
            $this->handleStreamException($e, BinaryStreamAccessException::STRING);
        }
    }
203781
public static function getTmpDir() {

		if (!self::$_sTmpDir) {
			$sTmpDir = Config::get('tango')['tmp_dir'];
			$sTmpDir = rtrim($sTmpDir, '/');
			if (!is_dir($sTmpDir) || !is_writable($sTmpDir)) {
				$sTmpDir = '/tmp'; // failback
			}
			self::$_sTmpDir = $sTmpDir;
		}

		return self::$_sTmpDir;
	}
940823
public function decodeString()
    {
        $len = $this->decodeUint32();
        if ($len === null) {
            return null;
        }
        $value = $this->decodeBytes($len);
        if ($value === null) {
            $this->buffer->unget(pack('N', $len));
            return null;
        }
        return $value;
    }
143034
public function toLowerCase() {
        $str = mb_strtolower($this->str, $this->encoding);

        return self::create($str, $this->encoding);
    }
1122513
public function reverse() {
		if(!$this->orderBy)
			throw new \Exception('Cannot reverse a query without order by.');

		preg_match_all('/([^,])*([(].*?[)])([^,])*|([^,])+/', $this->orderBy, $e);
		$e = $e[0];
		foreach($e as $k=>$v) {
			$v = preg_replace_callback('/(DESC|ASC)[\s]*/', function($r) {
				$r = $r[0];
				if(strpos($r, 'DESC') !== false)
					return str_replace('DESC', 'ASC', $r);
				else
					return str_replace('ASC', 'DESC', $r);
			}, $v, -1, $c);
			if($c === 0)
				$v = $v.' DESC';
			$e[$k] = $v;
		}
		$orderBy = implode(', ', $e);

		$this->orderBy($orderBy);
		return $this;
	}
159744
public function toString()
    {
        $headers = $this->toArray();
        $content = '';

        //Serialise the headers to a string
        foreach ($headers as $name => $value) {
            $content .= sprintf("%s %s\r\n", $name.':', $value);
        }

        return $content;
    }
670280
public static function reverse(string $str, string $encoding = null) : string
    {
        $encoding = $encoding ?: static::encoding($str);
        $length   = mb_strlen($str, $encoding);
        $result   = '';

        // Return early under obvious circumstances.
        if ($length === 0) {
            return $result;
        }

        // Reverse one character after the other, counting from the end.
        for ($i = $length - 1; $i >= 0; $i--) {
            $result .= mb_substr($str, $i, 1, $encoding);
        }

        return $result;
    }
522208
public function toString()
    {
        $stringAttr = array();

        foreach ($this->attributes as $name => $value) {
            $stringAttr[] = $name.'='.$this->escape($value);
        }

        return implode(',', $stringAttr);
    }
828492
public static function getString(&$str)
    {
        $p = mb_orig_strpos($str, "\x00");
        if ($p === false) {
            return '';
        }
        $r = mb_orig_substr($str, 0, $p);
        $str = mb_orig_substr($str, $p + 1);
        return $r;
    }
363715
public function readString()
    {
        if (!is_resource($this->fp)) {
            return $this->raiseError('not connected');
        }

        $string = '';
        while (($char = @fread($this->fp, 1)) !== "\x00") {
            $string .= $char;
        }

        return $string;
    }
1024887
public function reverse() {
		if (preg_match_all('/./us', $this->rawString, $matches)) {
			$rawString = join('', array_reverse($matches[0]));

			return new static($rawString, $this->charset);
		}
		else {
			return $this;
		}
	}
77861
public function serializeToString($rec = -1)
    {
        $string = '';

        if ($rec > -1) {
            $string .= $this->base128->setValue($rec << 3 | $this->wired_type);
        }

        $string .= $this->base128->setValue(strlen($this->value));
        $string .= $this->value;

        return $string;
    }